[whiteboard] Use extension point to add caps
This commit is contained in:
@@ -68,36 +68,30 @@ class WhiteboardPlugin(GajimPlugin):
|
|||||||
}
|
}
|
||||||
self.controls = []
|
self.controls = []
|
||||||
self.sid = None
|
self.sid = None
|
||||||
|
self.announce_caps = True
|
||||||
|
|
||||||
@log_calls('WhiteboardPlugin')
|
@log_calls('WhiteboardPlugin')
|
||||||
def _compute_caps_hash(self):
|
def _update_caps(self, account):
|
||||||
for a in app.connections:
|
if not self.announce_caps:
|
||||||
app.caps_hash[a] = caps_cache.compute_caps_hash([
|
return
|
||||||
app.gajim_identity], app.gajim_common_features + \
|
if NS_JINGLE_SXE not in app.gajim_optional_features[account]:
|
||||||
app.gajim_optional_features[a])
|
app.gajim_optional_features[account].append(NS_JINGLE_SXE)
|
||||||
# re-send presence with new hash
|
if NS_SXE not in app.gajim_optional_features[account]:
|
||||||
connected = app.connections[a].connected
|
app.gajim_optional_features[account].append(NS_SXE)
|
||||||
if connected > 1 and app.SHOW_LIST[connected] != 'invisible':
|
|
||||||
app.connections[a].change_status(app.SHOW_LIST[connected],
|
|
||||||
app.connections[a].status)
|
|
||||||
|
|
||||||
@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!')
|
||||||
if NS_JINGLE_SXE not in app.gajim_common_features:
|
for account in app.caps_hash:
|
||||||
app.gajim_common_features.append(NS_JINGLE_SXE)
|
if app.caps_hash[account] != '':
|
||||||
if NS_SXE not in app.gajim_common_features:
|
self.announce_caps = True
|
||||||
app.gajim_common_features.append(NS_SXE)
|
helpers.update_optional_features(account)
|
||||||
self._compute_caps_hash()
|
|
||||||
|
|
||||||
@log_calls('WhiteboardPlugin')
|
@log_calls('WhiteboardPlugin')
|
||||||
def deactivate(self):
|
def deactivate(self):
|
||||||
if NS_JINGLE_SXE in app.gajim_common_features:
|
self.announce_caps = False
|
||||||
app.gajim_common_features.remove(NS_JINGLE_SXE)
|
helpers.update_optional_features()
|
||||||
if NS_SXE in app.gajim_common_features:
|
|
||||||
app.gajim_common_features.remove(NS_SXE)
|
|
||||||
self._compute_caps_hash()
|
|
||||||
|
|
||||||
@log_calls('WhiteboardPlugin')
|
@log_calls('WhiteboardPlugin')
|
||||||
def connect_with_chat_control(self, control):
|
def connect_with_chat_control(self, control):
|
||||||
|
|||||||
Reference in New Issue
Block a user