summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0060/pubsub.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-10-11 20:37:50 -0400
committerLance Stout <lancestout@gmail.com>2011-10-11 20:37:50 -0400
commit4374729f20f32b10b7dea79438820edb83601a10 (patch)
tree95701df2b005b85a34819639181d1b1cef4854eb /sleekxmpp/plugins/xep_0060/pubsub.py
parent87999333cba548b52d112fc49ba4b621b2955e7e (diff)
downloadslixmpp-4374729f20f32b10b7dea79438820edb83601a10.tar.gz
slixmpp-4374729f20f32b10b7dea79438820edb83601a10.tar.bz2
slixmpp-4374729f20f32b10b7dea79438820edb83601a10.tar.xz
slixmpp-4374729f20f32b10b7dea79438820edb83601a10.zip
Update the docs for XEP-0060 publish method.
Diffstat (limited to 'sleekxmpp/plugins/xep_0060/pubsub.py')
-rw-r--r--sleekxmpp/plugins/xep_0060/pubsub.py30
1 files changed, 26 insertions, 4 deletions
diff --git a/sleekxmpp/plugins/xep_0060/pubsub.py b/sleekxmpp/plugins/xep_0060/pubsub.py
index 5e57004f..9e394ef2 100644
--- a/sleekxmpp/plugins/xep_0060/pubsub.py
+++ b/sleekxmpp/plugins/xep_0060/pubsub.py
@@ -302,11 +302,33 @@ class xep_0060(base_plugin):
def publish(self, jid, node, id=None, payload=None, options=None,
ifrom=None, block=True, callback=None, timeout=None):
"""
- Add or edit items in a node.
+ Add a new item to a node, or edit an existing item.
- You may publish an individual item using the item_id and payload
- parameters, or you may batch publish by using the items parameter
- which accepts a list of id/payload tuples.
+ For services that support it, you can use the publish command
+ as an event signal by not including an ID or payload.
+
+ When including a payload and you do not provide an ID then
+ the service will generally create an ID for you.
+
+ Publish options may be specified, and how those options
+ are processed is left to the service, such as treating
+ the options as preconditions that the node's settings
+ must match.
+
+ Arguments:
+ jid -- The JID of the pubsub service.
+ node -- The node to publish the item to.
+ id -- Optionally specify the ID of the item.
+ payload -- The item content to publish.
+ options -- A form of publish options.
+ ifrom -- Specify the sender's JID.
+ block -- Specify if the send call will block until a response
+ is received, or a timeout occurs. Defaults to True.
+ timeout -- The length of time (in seconds) to wait for a response
+ before exiting the send call if blocking is used.
+ Defaults to sleekxmpp.xmlstream.RESPONSE_TIMEOUT
+ callback -- Optional reference to a stream handler function. Will
+ be executed when a reply stanza is received.
"""
iq = self.xmpp.Iq(sto=jid, sfrom=ifrom, stype='set')
iq['pubsub']['publish']['node'] = node