Commit 6c2947ce authored by Adrian Georgescu's avatar Adrian Georgescu

Fixed publishing presence state

parent bbd43bac
...@@ -124,7 +124,7 @@ class BlinkPresenceState(object): ...@@ -124,7 +124,7 @@ class BlinkPresenceState(object):
blink_settings = BlinkSettings() blink_settings = BlinkSettings()
account_id = hashlib.md5(self.account.id).hexdigest() account_id = hashlib.md5(self.account.id.encode()).hexdigest()
timestamp = ISOTimestamp.now() timestamp = ISOTimestamp.now()
doc = pidf.PIDF(str(self.account.uri)) doc = pidf.PIDF(str(self.account.uri))
...@@ -223,7 +223,7 @@ class PresencePublicationHandler(object): ...@@ -223,7 +223,7 @@ class PresencePublicationHandler(object):
blink_settings = BlinkSettings() blink_settings = BlinkSettings()
services.sort(key=lambda obj: obj.timestamp.value if obj.timestamp else epoch, reverse=True) services.sort(key=lambda obj: obj.timestamp.value if obj.timestamp else epoch, reverse=True)
service = services[0] service = services[0]
if service.id in ('SID-%s' % uuid.UUID(SIPSimpleSettings().instance_id), 'SID-%s' % hashlib.md5(notification.sender.id).hexdigest()): if service.id in ('SID-%s' % uuid.UUID(SIPSimpleSettings().instance_id), 'SID-%s' % hashlib.md5(notification.sender.id.encode()).hexdigest()):
# Our current state is the winning one # Our current state is the winning one
return return
status = str(service.status.extended).title() status = str(service.status.extended).title()
......
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