summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2020-11-27 19:57:23 +0100
committermathieui <mathieui@mathieui.net>2020-11-27 20:02:03 +0100
commita245ba54bd117344a3651b57ca0694d894088b1a (patch)
tree3a01f6981aed2fae710e0029e4c40f8116f68f0f
parentc86a6ad299a9b84e33ff8a1977d77fc1f23337ef (diff)
downloadslixmpp-a245ba54bd117344a3651b57ca0694d894088b1a.tar.gz
slixmpp-a245ba54bd117344a3651b57ca0694d894088b1a.tar.bz2
slixmpp-a245ba54bd117344a3651b57ca0694d894088b1a.tar.xz
slixmpp-a245ba54bd117344a3651b57ca0694d894088b1a.zip
Remove protoxep_occupantid
And fix some minor details in 0421 plugin.
-rw-r--r--slixmpp/plugins/__init__.py2
-rw-r--r--slixmpp/plugins/protoxep_occupantid/__init__.py12
-rw-r--r--slixmpp/plugins/protoxep_occupantid/occupantid.py23
-rw-r--r--slixmpp/plugins/protoxep_occupantid/stanza.py16
-rw-r--r--slixmpp/plugins/xep_0421/occupant_id.py3
-rw-r--r--slixmpp/plugins/xep_0421/stanza.py1
6 files changed, 4 insertions, 53 deletions
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'}