Commit 5f35b297 authored by Philipp Hörist's avatar Philipp Hörist

Add property for server delays

parent e5773ba9
Pipeline #3100 passed with stages
in 28 seconds
......@@ -57,7 +57,11 @@ class Delay:
else:
jids = [self._client.get_bound_jid().getDomain()]
properties.timestamp = parse_delay(stanza, from_=jids)
server_delay = parse_delay(stanza, from_=jids)
if server_delay is not None:
properties.has_server_delay = True
properties.timestamp = server_delay
properties.user_timestamp = parse_delay(stanza, not_from=jids)
@staticmethod
......
......@@ -162,6 +162,7 @@ class MessageProperties:
self.thread = None
self.user_timestamp = None
self.timestamp = time.time()
self.has_server_delay = False
self.error = None
self.eme = None
self.http_auth = None
......@@ -184,6 +185,10 @@ class MessageProperties:
self.omemo = None
self.encrypted = None
@property
def has_user_delay(self):
return self.user_timestamp is not None
@property
def is_encrypted(self):
return self.encrypted is not None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment