diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2020-12-05 01:05:16 +0100 |
---|---|---|
committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2020-12-05 01:05:16 +0100 |
commit | 684247b375cb629c6a63944e12a42dd9ae59ac7c (patch) | |
tree | 586ab1e09e9c368814a9a5a26313203af4f050a7 | |
parent | 6db5bb65d337ebc0813a46420dbd8c7dacec74d8 (diff) | |
download | slixmpp-684247b375cb629c6a63944e12a42dd9ae59ac7c.tar.gz slixmpp-684247b375cb629c6a63944e12a42dd9ae59ac7c.tar.bz2 slixmpp-684247b375cb629c6a63944e12a42dd9ae59ac7c.tar.xz slixmpp-684247b375cb629c6a63944e12a42dd9ae59ac7c.zip |
XEP-0352: Only enable the feature on ClientXMPP
-rw-r--r-- | slixmpp/plugins/xep_0352/csi.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/slixmpp/plugins/xep_0352/csi.py b/slixmpp/plugins/xep_0352/csi.py index 93295b84..21bfe371 100644 --- a/slixmpp/plugins/xep_0352/csi.py +++ b/slixmpp/plugins/xep_0352/csi.py @@ -8,6 +8,7 @@ import logging +from slixmpp import ClientXMPP from slixmpp.stanza import StreamFeatures from slixmpp.xmlstream import register_stanza_plugin from slixmpp.plugins.base import BasePlugin @@ -40,17 +41,19 @@ class XEP_0352(BasePlugin): self.xmpp.register_stanza(stanza.Active) self.xmpp.register_stanza(stanza.Inactive) - self.xmpp.register_feature('csi', - self._handle_csi_feature, - restart=False, - order=self.order) + if isinstance(self.xmpp, ClientXMPP): + self.xmpp.register_feature('csi', + self._handle_csi_feature, + restart=False, + order=self.order) def plugin_end(self): if self.xmpp.is_component: return - self.xmpp.unregister_feature('csi', self.order) + if isinstance(self.xmpp, ClientXMPP): + self.xmpp.unregister_feature('csi', self.order) self.xmpp.remove_stanza(stanza.Active) self.xmpp.remove_stanza(stanza.Inactive) |