Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vmj-qt
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
vmj-qt
Commits
70cbf4b4
Commit
70cbf4b4
authored
Sep 06, 2022
by
Tijmen de Mes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed timestamps in incoming messages
parent
210006d5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
history.py
blink/history.py
+4
-4
messages.py
blink/messages.py
+5
-2
No files found.
blink/history.py
View file @
70cbf4b4
...
@@ -337,8 +337,8 @@ class MessageHistory(object, metaclass=Singleton):
...
@@ -337,8 +337,8 @@ class MessageHistory(object, metaclass=Singleton):
timestamp_native
=
message
.
timestamp
timestamp_native
=
message
.
timestamp
timestamp_utc
=
timestamp_native
.
replace
(
tzinfo
=
timezone
.
utc
)
timestamp_utc
=
timestamp_native
.
replace
(
tzinfo
=
timezone
.
utc
)
message
.
timestamp
=
timestamp_utc
-
message
.
timestamp
.
utcoffset
()
timestamp_fixed
=
timestamp_utc
-
message
.
timestamp
.
utcoffset
()
timestamp
=
parse
(
str
(
message
.
timestamp
))
timestamp
=
parse
(
str
(
timestamp_fixed
))
optional_fields
=
{}
optional_fields
=
{}
if
state
is
not
None
:
if
state
is
not
None
:
...
@@ -396,8 +396,8 @@ class MessageHistory(object, metaclass=Singleton):
...
@@ -396,8 +396,8 @@ class MessageHistory(object, metaclass=Singleton):
timestamp_native
=
message
.
timestamp
timestamp_native
=
message
.
timestamp
timestamp_utc
=
timestamp_native
.
replace
(
tzinfo
=
timezone
.
utc
)
timestamp_utc
=
timestamp_native
.
replace
(
tzinfo
=
timezone
.
utc
)
message
.
timestamp
=
timestamp_utc
-
message
.
timestamp
.
utcoffset
()
timestamp_fixed
=
timestamp_utc
-
message
.
timestamp
.
utcoffset
()
timestamp
=
parse
(
str
(
message
.
timestamp
))
timestamp
=
parse
(
str
(
timestamp_fixed
))
optional_fields
=
{}
optional_fields
=
{}
if
state
is
not
None
:
if
state
is
not
None
:
...
...
blink/messages.py
View file @
70cbf4b4
...
@@ -21,7 +21,7 @@ from application.python import Null
...
@@ -21,7 +21,7 @@ from application.python import Null
from
application.system
import
makedirs
from
application.system
import
makedirs
from
application.python.types
import
Singleton
from
application.python.types
import
Singleton
from
datetime
import
timezone
from
datetime
import
timezone
from
dateutil.tz
import
tzlocal
from
dateutil.tz
import
tzlocal
,
tzutc
from
urllib.parse
import
urlsplit
,
urlunsplit
,
quote
from
urllib.parse
import
urlsplit
,
urlunsplit
,
quote
from
zope.interface
import
implementer
from
zope.interface
import
implementer
...
@@ -947,7 +947,10 @@ class MessageManager(object, metaclass=Singleton):
...
@@ -947,7 +947,10 @@ class MessageManager(object, metaclass=Singleton):
session_manager
=
SessionManager
()
session_manager
=
SessionManager
()
notification_center
=
NotificationCenter
()
notification_center
=
NotificationCenter
()
timestamp
=
str
(
cpim_message
.
timestamp
)
if
cpim_message
is
not
None
and
cpim_message
.
timestamp
is
not
None
else
str
(
ISOTimestamp
.
now
())
timestamp
=
cpim_message
.
timestamp
if
cpim_message
is
not
None
and
cpim_message
.
timestamp
is
not
None
else
ISOTimestamp
.
now
()
if
timestamp
.
tzinfo
is
tzutc
():
timestamp
=
timestamp
.
replace
(
tzinfo
=
timezone
.
utc
)
.
astimezone
(
tzlocal
())
timestamp
=
str
(
timestamp
)
message
=
BlinkMessage
(
body
,
content_type
,
sender
,
timestamp
=
timestamp
,
id
=
message_id
,
disposition
=
disposition
,
direction
=
'incoming'
)
message
=
BlinkMessage
(
body
,
content_type
,
sender
,
timestamp
=
timestamp
,
id
=
message_id
,
disposition
=
disposition
,
direction
=
'incoming'
)
if
x_replicated_message
is
not
Null
:
if
x_replicated_message
is
not
Null
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment