source: doc/xmppim.rst @ 172:ea2774e1c71c

Last change on this file since 172:ea2774e1c71c was 172:ea2774e1c71c, checked in by Ralph Meijer <ralphm@…>, 10 years ago

Clean up of RosterItem? and RosterClientProtocol?.

RosterItem:

  • Renamed attributes jid and ask to entity and pendingOut respectively.
  • Can represent roster items to be removed or that have been removed.
  • Now has fromElement and toElement methods.

RosterRequest is a new class to represent roster request stanzas.

RosterClientProtocol:

  • Roster returned from getRoster is now indexed by JIDs (instead of the unicode representation of the JID).
  • Outgoing requests are now done using RosterRequest.
  • onRosterSet and onRosterRemove are deprecated in favor of setReceived and removeReceived, respectively. These are called with a RosterRequest to have access to addressing and roster version information.

RosterPushIgnored can be raised to return a service-unavailable stanza
error for unwanted pushes.

This also fixes a problem with checking the sender address for roster pushes.

Author: ralphm.
Fixes: #71.

File size: 876 bytes
RevLine 
[172]1XMPP IM protocol support
2========================
3
4Roster Management
5-----------------
6
7A roster holds a collection of contacts for a user. Typically a user has one
8roster kept by the user's server, but rosters may also be kept by other
9entities. Usually, a client requests a user's roster right after
10authentication, and is then notified of any changes to the roster. A client may
11also modify the roster, on behalf of the user, by setting or removing roster
12items.
13
14Requesting the roster
15^^^^^^^^^^^^^^^^^^^^^
16
17.. literalinclude:: listings/xmppim/roster_client_get.py
18   :language: python
19   :linenos:
20
21Receiving roster pushes
22^^^^^^^^^^^^^^^^^^^^^^^
23
24.. literalinclude:: listings/xmppim/roster_client_push.py
25   :language: python
26   :linenos:
27
28Remove a contact
29^^^^^^^^^^^^^^^^
30
31.. literalinclude:: listings/xmppim/roster_client_remove.py
32   :language: python
33   :linenos:
Note: See TracBrowser for help on using the repository browser.