Commit 52149b7d authored by Saul Ibarra's avatar Saul Ibarra

Only publish icon URL if one was set

parent e2b683c8
......@@ -95,7 +95,7 @@ class BlinkPresenceSettings(SettingsGroup):
current_state = Setting(type=PresenceState, default=PresenceState('Available'))
state_history = Setting(type=PresenceStateList, default=PresenceStateList())
offline_note = Setting(type=unicode, nillable=True)
icon = Setting(type=IconDescriptor, nillable=True)
icon = Setting(type=IconDescriptor, default=IconDescriptor('blink://unknown'), nillable=True)
class BlinkSettings(SettingsObject):
......
......@@ -103,7 +103,12 @@ class BlinkPresenceState(object):
service.capabilities.screen_sharing_server = False
service.capabilities.screen_sharing_client = False
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 else unknown_icon
if account.xcap.icon is None:
service.icon = None
elif account.xcap.icon.url == unknown_icon:
service.icon = unknown_icon
else:
service.icon = "%s#blink-icon%s" % (self.account.xcap.icon.url, self.account.xcap.icon.etag)
service.device_info = pidf.DeviceInfo(instance_id, description=hostname, user_agent=settings.user_agent)
service.device_info.time_offset = pidf.TimeOffset()
# TODO: Add real user input data -Saul
......
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