core, frontends: various fixes for Libervia:
- quick_app: don't fail when we can't get autodisconnect parameter
- bridge: removed useless BridgeFrontend parent class
- use of TypeError, unicode and list to workaround Pyjamas incompatibilities
This commit is contained in:
parent
27f5dd80bf
commit
9b0542fb46
2 changed files with 13 additions and 14 deletions
|
|
@ -76,10 +76,15 @@ class ProfileManager(object):
|
|||
self.whoami = jid.JID(jid_s) # resource might change after the connection
|
||||
self.bridge.isConnected(self.profile, callback=self._plug_profile_isconnected)
|
||||
|
||||
def _autodisconnectEb(self, failure_):
|
||||
# XXX: we ignore error on this parameter, as Libervia can't access it
|
||||
log.warning(_("Error while trying to get autodisconnect param, ignoring: {}").format(failure_))
|
||||
self._plug_profile_autodisconnect("false")
|
||||
|
||||
def _plug_profile_isconnected(self, connected):
|
||||
self.connected = connected
|
||||
self.bridge.asyncGetParamA("autodisconnect", "Connection", profile_key=self.profile,
|
||||
callback=self._plug_profile_autodisconnect, errback=self._getParamError)
|
||||
callback=self._plug_profile_autodisconnect, errback=self._autodisconnectEb)
|
||||
|
||||
def _plug_profile_autodisconnect(self, autodisconnect):
|
||||
if C.bool(autodisconnect):
|
||||
|
|
|
|||
|
|
@ -139,7 +139,8 @@ class Message(object):
|
|||
except KeyError:
|
||||
log.error(u"extra data is missing user nick for uid {}".format(self.uid))
|
||||
return ""
|
||||
if self.parent.type == C.CHAT_GROUP or entity in contact_list.getSpecials(C.CONTACT_SPECIAL_GROUP):
|
||||
# FIXME: converted getSpecials to list for pyjamas
|
||||
if self.parent.type == C.CHAT_GROUP or entity in list(contact_list.getSpecials(C.CONTACT_SPECIAL_GROUP)):
|
||||
return entity.resource or ""
|
||||
if entity.bare in contact_list:
|
||||
return contact_list.getCache(entity, 'nick') or contact_list.getCache(entity, 'name') or entity.node or entity
|
||||
|
|
@ -292,7 +293,7 @@ class QuickChat(quick_widgets.QuickWidget):
|
|||
@staticmethod
|
||||
def getWidgetHash(target, profiles):
|
||||
profile = list(profiles)[0]
|
||||
return profile + "\n" + target.bare
|
||||
return profile + "\n" + unicode(target.bare)
|
||||
|
||||
@staticmethod
|
||||
def getPrivateHash(target, profile):
|
||||
|
|
|
|||
Loading…
Reference in a new issue