xep_049: implement bookmarks pinning stanzas
This commit is contained in:
@@ -119,6 +119,7 @@ PLUGINS = [
|
||||
'xep_0444', # Message Reactions
|
||||
'xep_0447', # Stateless file sharing
|
||||
'xep_0461', # Message Replies
|
||||
'xep_0469', # Bookmarks Pinning
|
||||
# Meant to be imported by plugins
|
||||
]
|
||||
|
||||
|
||||
8
slixmpp/plugins/xep_0469/__init__.py
Normal file
8
slixmpp/plugins/xep_0469/__init__.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from slixmpp.plugins.base import register_plugin
|
||||
|
||||
from . import stanza
|
||||
from .pinning import XEP_0469
|
||||
|
||||
register_plugin(XEP_0469)
|
||||
|
||||
__all__ = ['stanza', 'XEP_0469']
|
||||
17
slixmpp/plugins/xep_0469/pinning.py
Normal file
17
slixmpp/plugins/xep_0469/pinning.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from slixmpp.plugins import BasePlugin
|
||||
from . import stanza
|
||||
|
||||
|
||||
class XEP_0469(BasePlugin):
|
||||
|
||||
"""
|
||||
XEP-0469: Bookmark Pinning
|
||||
"""
|
||||
|
||||
name = "xep_0469"
|
||||
description = "XEP-0469: Bookmark Pinning"
|
||||
dependencies = {"xep_0402"}
|
||||
stanza = stanza
|
||||
|
||||
def plugin_init(self):
|
||||
stanza.register_plugin()
|
||||
31
slixmpp/plugins/xep_0469/stanza.py
Normal file
31
slixmpp/plugins/xep_0469/stanza.py
Normal file
@@ -0,0 +1,31 @@
|
||||
from slixmpp import register_stanza_plugin
|
||||
from slixmpp.plugins.xep_0402.stanza import Extensions
|
||||
from slixmpp.xmlstream import ElementBase
|
||||
|
||||
NS = "urn:xmpp:bookmarks-pinning:0"
|
||||
|
||||
|
||||
class Pinned(ElementBase):
|
||||
"""
|
||||
Pinned bookmark element
|
||||
|
||||
|
||||
To enable it on a Conference element, use enable() like this:
|
||||
|
||||
.. code-block::python
|
||||
|
||||
# C being a Conference element
|
||||
C['extensions'].enable('pinned')
|
||||
|
||||
Which will add the <pinned> element to the <extensions> element.
|
||||
"""
|
||||
namespace = NS
|
||||
name = "pinned"
|
||||
plugin_attrib = "pinned"
|
||||
interfaces = {"pinned"}
|
||||
bool_interfaces = {"pinned"}
|
||||
is_extension = True
|
||||
|
||||
|
||||
def register_plugin():
|
||||
register_stanza_plugin(Extensions, Pinned)
|
||||
Reference in New Issue
Block a user