From a245ba54bd117344a3651b57ca0694d894088b1a Mon Sep 17 00:00:00 2001 From: mathieui Date: Fri, 27 Nov 2020 19:57:23 +0100 Subject: Remove protoxep_occupantid And fix some minor details in 0421 plugin. --- slixmpp/plugins/__init__.py | 2 +- slixmpp/plugins/protoxep_occupantid/__init__.py | 12 ------------ slixmpp/plugins/protoxep_occupantid/occupantid.py | 23 ----------------------- slixmpp/plugins/protoxep_occupantid/stanza.py | 16 ---------------- slixmpp/plugins/xep_0421/occupant_id.py | 3 ++- slixmpp/plugins/xep_0421/stanza.py | 1 + 6 files changed, 4 insertions(+), 53 deletions(-) delete mode 100644 slixmpp/plugins/protoxep_occupantid/__init__.py delete mode 100644 slixmpp/plugins/protoxep_occupantid/occupantid.py delete mode 100644 slixmpp/plugins/protoxep_occupantid/stanza.py diff --git a/slixmpp/plugins/__init__.py b/slixmpp/plugins/__init__.py index c21cc343..a89b10f6 100644 --- a/slixmpp/plugins/__init__.py +++ b/slixmpp/plugins/__init__.py @@ -86,6 +86,6 @@ __all__ = [ 'xep_0325', # IoT Systems Control 'xep_0332', # HTTP Over XMPP Transport 'xep_0377', # Spam reporting + 'xep_0421', # Anonymous unique occupant identifiers for MUCs 'xep_0444', # Message Reactions - 'protoxep_occupantid', # https://dino.im/xeps/occupant-id.html ] diff --git a/slixmpp/plugins/protoxep_occupantid/__init__.py b/slixmpp/plugins/protoxep_occupantid/__init__.py deleted file mode 100644 index 1bd374b6..00000000 --- a/slixmpp/plugins/protoxep_occupantid/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -""" - Slixmpp: The Slick XMPP Library - Copyright (C) 2019 Mathieu Pasquet - This file is part of Slixmpp. - - See the file LICENSE for copying permission. -""" -from slixmpp.plugins.base import register_plugin -from slixmpp.plugins.protoxep_occupantid.occupantid import XEP_OccupantID -from slixmpp.plugins.protoxep_occupantid.stanza import OccupantID - -register_plugin(XEP_OccupantID) diff --git a/slixmpp/plugins/protoxep_occupantid/occupantid.py b/slixmpp/plugins/protoxep_occupantid/occupantid.py deleted file mode 100644 index 7f4a9d4a..00000000 --- a/slixmpp/plugins/protoxep_occupantid/occupantid.py +++ /dev/null @@ -1,23 +0,0 @@ -""" - Slixmpp: The Slick XMPP Library - Copyright (C) 2019 Mathieu Pasquet - This file is part of Slixmpp. - - See the file LICENSE for copying permission. -""" -from slixmpp.plugins import BasePlugin -from slixmpp.stanza import Message, Presence -from slixmpp.xmlstream import register_stanza_plugin - -from slixmpp.plugins.protoxep_occupantid import stanza - - -class XEP_OccupantID(BasePlugin): - name = 'protoxep_occupantid' - description = 'XEP-XXXX: Anonymous unique occupant identifiers for MUCs' - dependencies = set() - stanza = stanza - - def plugin_init(self): - register_stanza_plugin(Message, stanza.OccupantID) - register_stanza_plugin(Presence, stanza.OccupantID) diff --git a/slixmpp/plugins/protoxep_occupantid/stanza.py b/slixmpp/plugins/protoxep_occupantid/stanza.py deleted file mode 100644 index e5853111..00000000 --- a/slixmpp/plugins/protoxep_occupantid/stanza.py +++ /dev/null @@ -1,16 +0,0 @@ -""" - Slixmpp: The Slick XMPP Library - Copyright (C) 2019 Mathieu Pasquet - This file is part of Slixmpp. - - See the file LICENSE for copying permission. -""" - -from slixmpp.xmlstream import ElementBase - - -class OccupantID(ElementBase): - name = 'occupant-id' - plugin_attrib = 'occupant-id' - namespace = 'urn:xmpp:occupant-id:0' - interfaces = {'id'} diff --git a/slixmpp/plugins/xep_0421/occupant_id.py b/slixmpp/plugins/xep_0421/occupant_id.py index 116bf2d9..4ee27a09 100644 --- a/slixmpp/plugins/xep_0421/occupant_id.py +++ b/slixmpp/plugins/xep_0421/occupant_id.py @@ -6,7 +6,7 @@ See the file LICENSE for copying permission. """ -from slixmpp import JID, Message +from slixmpp import JID, Message, Presence from slixmpp.plugins import BasePlugin from slixmpp.xmlstream import register_stanza_plugin from slixmpp.plugins.xep_0421 import stanza @@ -25,6 +25,7 @@ class XEP_0421(BasePlugin): def plugin_init(self) -> None: # XXX: This should be MucMessage. Someday.. register_stanza_plugin(Message, OccupantId) + register_stanza_plugin(Presence, OccupantId) async def has_feature(self, jid: JID) -> bool: info = await self.xmpp['xep_0030'].get_info(jid) diff --git a/slixmpp/plugins/xep_0421/stanza.py b/slixmpp/plugins/xep_0421/stanza.py index 0cb93959..ab1128d6 100644 --- a/slixmpp/plugins/xep_0421/stanza.py +++ b/slixmpp/plugins/xep_0421/stanza.py @@ -36,5 +36,6 @@ class OccupantId(ElementBase): ''' name = 'occupant-id' + plugin_attrib = 'occupant-id' namespace = NS interface = {'id'} -- cgit v1.2.3