[whiteboard] Adapt updating caps

This commit is contained in:
lovetox
2020-04-04 11:32:49 +02:00
parent 90b0134f3f
commit 455c7968fe

View File

@@ -82,27 +82,27 @@ class WhiteboardPlugin(GajimPlugin):
self.announce_caps = True self.announce_caps = True
@log_calls('WhiteboardPlugin') @log_calls('WhiteboardPlugin')
def _update_caps(self, account): def _update_caps(self, _account, features):
if not self.announce_caps: if not self.announce_caps:
return return
if NS_JINGLE_SXE not in app.gajim_optional_features[account]:
app.gajim_optional_features[account].append(NS_JINGLE_SXE) features.append(NS_JINGLE_SXE)
if NS_SXE not in app.gajim_optional_features[account]: features.append(NS_SXE)
app.gajim_optional_features[account].append(NS_SXE)
@log_calls('WhiteboardPlugin') @log_calls('WhiteboardPlugin')
def activate(self): def activate(self):
if not HAS_GOOCANVAS: if not HAS_GOOCANVAS:
raise GajimPluginException('python-pygoocanvas is missing!') raise GajimPluginException('python-pygoocanvas is missing!')
for account in app.caps_hash:
if app.caps_hash[account] != '': self.announce_caps = True
self.announce_caps = True for con in app.connections.values():
helpers.update_optional_features(account) con.get_module('Caps').update_caps()
@log_calls('WhiteboardPlugin') @log_calls('WhiteboardPlugin')
def deactivate(self): def deactivate(self):
self.announce_caps = False self.announce_caps = False
helpers.update_optional_features() for con in app.connections.values():
con.get_module('Caps').update_caps()
@log_calls('WhiteboardPlugin') @log_calls('WhiteboardPlugin')
def connect_with_chat_control(self, control): def connect_with_chat_control(self, control):