# HG changeset patch # User Goffi # Date 1554492123 -7200 # Node ID 0c54970d8e6ef14dc1c5fd4278452b3d66b7ce69 # Parent 13e0a260e7b8cd95afd749126f432dfd3319d259 plugin android: fixed csi_timer reset in setActive + crash on call of isActive before session initialisation diff -r 13e0a260e7b8 -r 0c54970d8e6e sat/plugins/plugin_misc_android.py --- a/sat/plugins/plugin_misc_android.py Thu Mar 28 08:40:38 2019 +0100 +++ b/sat/plugins/plugin_misc_android.py Fri Apr 05 21:22:03 2019 +0200 @@ -245,5 +245,6 @@ return if self._csi_timer is not None: self._csi_timer.cancel() + self._csi_timer = None for client in self.host.getClients(C.PROF_KEY_ALL): self._csi.setActive(client) diff -r 13e0a260e7b8 -r 0c54970d8e6e sat/plugins/plugin_xep_0352.py --- a/sat/plugins/plugin_xep_0352.py Thu Mar 28 08:40:38 2019 +0100 +++ b/sat/plugins/plugin_xep_0352.py Fri Apr 05 21:22:03 2019 +0200 @@ -47,9 +47,16 @@ host.registerNamespace(u"csi", NS_CSI) def isActive(self, client): - if not client._xep_0352_enabled: + try: + if not client._xep_0352_enabled: + return True + return client._xep_0352_active + except AttributeError: + # _xep_0352_active can not be set if isActive is called before + # profileConnected has been called + log.debug(u"isActive called when XEP-0352 plugin has not yet set the " + u"attributes") return True - return client._xep_0352_active def profileConnected(self, client): if (NS_CSI, u'csi') in client.xmlstream.features: