summaryrefslogtreecommitdiff
path: root/slixmpp/plugins/xep_0249
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2020-12-10 19:20:23 +0100
committermathieui <mathieui@mathieui.net>2020-12-10 19:22:40 +0100
commit95d40a3ca336a4e1b66c7ed287ec3f2ef92b201c (patch)
treeef3086be7313a8e61e51b7a3efed302d0e154cb0 /slixmpp/plugins/xep_0249
parent010bf6dd70a44d9e9087336bc955a591ab9248b3 (diff)
downloadslixmpp-95d40a3ca336a4e1b66c7ed287ec3f2ef92b201c.tar.gz
slixmpp-95d40a3ca336a4e1b66c7ed287ec3f2ef92b201c.tar.bz2
slixmpp-95d40a3ca336a4e1b66c7ed287ec3f2ef92b201c.tar.xz
slixmpp-95d40a3ca336a4e1b66c7ed287ec3f2ef92b201c.zip
docs: update docstrings for sphinx conformity
Remove most references to timeout/callback/ifrom/timeout_callbacks args
Diffstat (limited to 'slixmpp/plugins/xep_0249')
-rw-r--r--slixmpp/plugins/xep_0249/invite.py28
-rw-r--r--slixmpp/plugins/xep_0249/stanza.py6
2 files changed, 21 insertions, 13 deletions
diff --git a/slixmpp/plugins/xep_0249/invite.py b/slixmpp/plugins/xep_0249/invite.py
index 9f08eae3..4be6921f 100644
--- a/slixmpp/plugins/xep_0249/invite.py
+++ b/slixmpp/plugins/xep_0249/invite.py
@@ -7,9 +7,10 @@
"""
import logging
+from typing import Optional
import slixmpp
-from slixmpp import Message
+from slixmpp import Message, JID
from slixmpp.plugins import BasePlugin
from slixmpp.xmlstream import register_stanza_plugin
from slixmpp.xmlstream.handler import Callback
@@ -46,7 +47,7 @@ class XEP_0249(BasePlugin):
def session_bind(self, jid):
self.xmpp['xep_0030'].add_feature(Invite.namespace)
- def _handle_invite(self, msg):
+ def _handle_invite(self, msg: Message):
"""
Raise an event for all invitations received.
"""
@@ -55,25 +56,26 @@ class XEP_0249(BasePlugin):
self.xmpp.event('groupchat_direct_invite', msg)
- def send_invitation(self, jid, roomjid, password=None,
- reason=None, ifrom=None):
+ def send_invitation(self, jid: JID, roomjid: JID,
+ password: Optional[str] = None,
+ reason: Optional[str] = None, *,
+ mfrom: Optional[JID] = None):
"""
Send a direct MUC invitation to an XMPP entity.
- Arguments:
- jid -- The JID of the entity that will receive
+ :param JID jid: The JID of the entity that will receive
the invitation
- roomjid -- the address of the groupchat room to be joined
- password -- a password needed for entry into a
- password-protected room (OPTIONAL).
- reason -- a human-readable purpose for the invitation
- (OPTIONAL).
+ :param JID roomjid: the address of the groupchat room to be joined
+ :param str password: a password needed for entry into a
+ password-protected room (OPTIONAL).
+ :param str reason: a human-readable purpose for the invitation
+ (OPTIONAL).
"""
msg = self.xmpp.Message()
msg['to'] = jid
- if ifrom is not None:
- msg['from'] = ifrom
+ if mfrom is not None:
+ msg['from'] = mfrom
msg['groupchat_invite']['jid'] = roomjid
if password is not None:
msg['groupchat_invite']['password'] = password
diff --git a/slixmpp/plugins/xep_0249/stanza.py b/slixmpp/plugins/xep_0249/stanza.py
index 5979f091..8633c67e 100644
--- a/slixmpp/plugins/xep_0249/stanza.py
+++ b/slixmpp/plugins/xep_0249/stanza.py
@@ -17,6 +17,9 @@ class Invite(ElementBase):
done through the server).
Example invite stanza:
+
+ ::
+
<message from='crone1@shakespeare.lit/desktop'
to='hecate@shakespeare.lit'>
<x xmlns='jabber:x:conference'
@@ -26,6 +29,9 @@ class Invite(ElementBase):
</message>
Stanza Interface:
+
+ ::
+
jid -- The JID of the groupchat room
password -- The password used to gain entry in the room
(optional)