XEP-0352: Only enable the feature on ClientXMPP
This commit is contained in:
parent
6db5bb65d3
commit
684247b375
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from slixmpp import ClientXMPP
|
||||||
from slixmpp.stanza import StreamFeatures
|
from slixmpp.stanza import StreamFeatures
|
||||||
from slixmpp.xmlstream import register_stanza_plugin
|
from slixmpp.xmlstream import register_stanza_plugin
|
||||||
from slixmpp.plugins.base import BasePlugin
|
from slixmpp.plugins.base import BasePlugin
|
||||||
@ -40,6 +41,7 @@ class XEP_0352(BasePlugin):
|
|||||||
self.xmpp.register_stanza(stanza.Active)
|
self.xmpp.register_stanza(stanza.Active)
|
||||||
self.xmpp.register_stanza(stanza.Inactive)
|
self.xmpp.register_stanza(stanza.Inactive)
|
||||||
|
|
||||||
|
if isinstance(self.xmpp, ClientXMPP):
|
||||||
self.xmpp.register_feature('csi',
|
self.xmpp.register_feature('csi',
|
||||||
self._handle_csi_feature,
|
self._handle_csi_feature,
|
||||||
restart=False,
|
restart=False,
|
||||||
@ -50,6 +52,7 @@ class XEP_0352(BasePlugin):
|
|||||||
if self.xmpp.is_component:
|
if self.xmpp.is_component:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if isinstance(self.xmpp, ClientXMPP):
|
||||||
self.xmpp.unregister_feature('csi', self.order)
|
self.xmpp.unregister_feature('csi', self.order)
|
||||||
self.xmpp.remove_stanza(stanza.Active)
|
self.xmpp.remove_stanza(stanza.Active)
|
||||||
self.xmpp.remove_stanza(stanza.Inactive)
|
self.xmpp.remove_stanza(stanza.Inactive)
|
||||||
|
Loading…
Reference in New Issue
Block a user