comparison cagou/plugins/plugin_wid_file_sharing.py @ 211:b25d03403898

plugin file sharing: fixed name for service devices
author Goffi <goffi@goffi.org>
date Fri, 25 May 2018 14:17:17 +0200
parents 890b48e41998
children 38b43ed18bb5
comparison
equal deleted inserted replaced
210:f1ee7a8cf77c 211:b25d03403898
210 class DeviceWidget(ItemWidget): 210 class DeviceWidget(ItemWidget):
211 211
212 def __init__(self, sharing_wid, entity_jid, identities): 212 def __init__(self, sharing_wid, entity_jid, identities):
213 self.entity_jid = entity_jid 213 self.entity_jid = entity_jid
214 self.identities = identities 214 self.identities = identities
215 self.own_device = entity_jid.bare == next(G.host.profiles.itervalues()).whoami 215 own_jid = next(G.host.profiles.itervalues()).whoami
216 name = self.identities.name if self.own_device else self.entity_jid.node 216 self.own_device = entity_jid.bare == own_jid
217 if self.own_device:
218 name = self.identities.name
219 elif self.entity_jid.node:
220 name = self.entity_jid.node
221 elif self.entity_jid.domain == own_jid.domain:
222 name = _(u"your server")
223 else:
224 name = _(u"sharing component")
225
217 super(DeviceWidget, self).__init__(sharing_wid, name) 226 super(DeviceWidget, self).__init__(sharing_wid, name)
218 227
219 def getSymbol(self): 228 def getSymbol(self):
220 if self.identities.type == 'desktop': 229 if self.identities.type == 'desktop':
221 return 'desktop' 230 return 'desktop'