Commit b813db41 authored by Dan Pascu's avatar Dan Pascu

Include display name and icon in the offline status document as well

parent 52b2fd9e
...@@ -139,6 +139,8 @@ class BlinkPresenceState(object): ...@@ -139,6 +139,8 @@ class BlinkPresenceState(object):
service.contact = str(self.account.uri) service.contact = str(self.account.uri)
service.timestamp = timestamp service.timestamp = timestamp
service.capabilities = caps.ServiceCapabilities() service.capabilities = caps.ServiceCapabilities()
service.display_name = self.account.display_name or None
service.icon = "%s#blink-icon%s" % (self.account.xcap.icon.url, self.account.xcap.icon.etag) if self.account.xcap.icon is not None else None
service.notes.add(blink_settings.presence.offline_note) service.notes.add(blink_settings.presence.offline_note)
doc.add(service) doc.add(service)
...@@ -190,6 +192,9 @@ class PresencePublicationHandler(object): ...@@ -190,6 +192,9 @@ class PresencePublicationHandler(object):
account.save() account.save()
elif {'presence.enabled', 'display_name', 'xcap.icon'}.intersection(notification.data.modified) and account.presence.enabled: elif {'presence.enabled', 'display_name', 'xcap.icon'}.intersection(notification.data.modified) and account.presence.enabled:
account.presence_state = BlinkPresenceState(account).online_state account.presence_state = BlinkPresenceState(account).online_state
if hasattr(account, 'xcap') and account.enabled and account.xcap.enabled and account.xcap.discovered:
state = BlinkPresenceState(account).offline_state
account.xcap_manager.set_offline_status(OfflineStatus(state) if state is not None else None)
def _NH_SIPAccountWillActivate(self, notification): def _NH_SIPAccountWillActivate(self, notification):
account = notification.sender account = notification.sender
......
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