diff options
author | Lance Stout <lancestout@gmail.com> | 2011-06-16 16:03:31 -0700 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2011-06-16 16:03:31 -0700 |
commit | 29d775e6756e7d8028438942ca2d34d1c39c559f (patch) | |
tree | 94d8b81a50d5f30eaa0e841ae9fa9b7d8f023626 /sleekxmpp/roster/multi.py | |
parent | 251a47db8cd3262589ffdae5167dd5c4dee065a9 (diff) | |
download | slixmpp-29d775e6756e7d8028438942ca2d34d1c39c559f.tar.gz slixmpp-29d775e6756e7d8028438942ca2d34d1c39c559f.tar.bz2 slixmpp-29d775e6756e7d8028438942ca2d34d1c39c559f.tar.xz slixmpp-29d775e6756e7d8028438942ca2d34d1c39c559f.zip |
Integrate roster with BaseXMPP.
Last sent stanzas are saved regardless of if the roster is used
directly or self.send_presence
Diffstat (limited to 'sleekxmpp/roster/multi.py')
-rw-r--r-- | sleekxmpp/roster/multi.py | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/sleekxmpp/roster/multi.py b/sleekxmpp/roster/multi.py index cd4a5195..e9f3389e 100644 --- a/sleekxmpp/roster/multi.py +++ b/sleekxmpp/roster/multi.py @@ -34,7 +34,8 @@ class Roster(object): Defaults to True. Methods: - add -- Create a new roster node for a JID. + add -- Create a new roster node for a JID. + send_presence -- Shortcut for sending a presence stanza. """ def __init__(self, xmpp, db=None): @@ -113,3 +114,27 @@ class Roster(object): """ for node in self: self[node].reset() + + def send_presence(self, pshow=None, pstatus=None, ppriority=None, + pto=None, pfrom=None, ptype=None, pnick=None): + """ + Create, initialize, and send a Presence stanza. + + Forwards the send request to the appropriate roster to + perform the actual sending. + + Arguments: + pshow -- The presence's show value. + pstatus -- The presence's status message. + ppriority -- This connections' priority. + pto -- The recipient of a directed presence. + ptype -- The type of presence, such as 'subscribe'. + pfrom -- The sender of the presence. + pnick -- Optional nickname of the presence's sender. + """ + self[pfrom].send_presence(ptype=ptype, + pshow=pshow, + pstatus=pstatus, + ppriority=ppriority, + pnick=pnick, + pto=pto) |