XEP-0359: Unique and Stable Stanza IDs

(was partially supported in places before)
This commit is contained in:
mathieui 2020-12-02 19:47:46 +01:00
parent 58c3579f74
commit c63e9a32b9
4 changed files with 71 additions and 0 deletions

View file

@ -86,6 +86,7 @@ __all__ = [
'xep_0325', # IoT Systems Control
'xep_0332', # HTTP Over XMPP Transport
'xep_0353', # Jingle Message Initiation
'xep_0359', # Unique and Stable Stanza IDs
'xep_0363', # HTTP File Upload
'xep_0369', # MIX-CORE
'xep_0377', # Spam reporting

View file

@ -0,0 +1,13 @@
"""
Slixmpp: The Slick XMPP Library
Copyright (C) 2020 Mathieu Pasquet <mathieui@mathieui.net>
This file is part of Slixmpp.
See the file LICENSE for copying permission.
"""
from slixmpp.plugins.base import register_plugin
from slixmpp.plugins.xep_0359.stanza import *
from slixmpp.plugins.xep_0359.stanzaid import XEP_0359
register_plugin(XEP_0359)

View file

@ -0,0 +1,35 @@
"""
Slixmpp: The Slick XMPP Library
Copyright (C) 2020 Mathieu Pasquet <mathieui@mathieui.net>
This file is part of Slixmpp.
See the file LICENSE for copying permissio
"""
from slixmpp.stanza import Message
from slixmpp.xmlstream import (
ElementBase,
register_stanza_plugin,
)
NS = 'urn:xmpp:sid:0'
class StanzaID(ElementBase):
namespace = NS
name = 'stanza-id'
plugin_attrib = 'stanza_id'
interfaces = {'id', 'by'}
class OriginID(ElementBase):
namespace = NS
name = 'origin-id'
plugin_attrib = 'origin_id'
interfaces = {'id'}
def register_plugins():
register_stanza_plugin(Message, StanzaID)
register_stanza_plugin(Message, OriginID)

View file

@ -0,0 +1,22 @@
"""
Slixmpp: The Slick XMPP Library
Copyright (C) 2020 Mathieu Pasquet <mathieui@mathieui.net>
This file is part of Slixmpp.
See the file LICENSE for copying permission.
"""
from slixmpp.plugins import BasePlugin
from slixmpp.plugins.xep_0359 import stanza
class XEP_0359(BasePlugin):
'''XEP-0359: Unique and Stable Stanza IDs'''
name = 'xep_0359'
description = 'Unique and Stable Stanza IDs'
dependencies = set()
stanza = stanza
namespace = stanza.NS
def plugin_init(self) -> None:
stanza.register_plugins()