summaryrefslogtreecommitdiff
path: root/docs/create_plugin.rst
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2015-02-24 18:58:40 +0100
committermathieui <mathieui@mathieui.net>2015-02-24 22:47:15 +0100
commitc66a4d4097a249efc029b761d6150378a54bf702 (patch)
treeb25d5872f0ab8036c8b05b4207b03163f4bc7868 /docs/create_plugin.rst
parente112e864756f1222a044ee28e3c13c5925618b0c (diff)
downloadslixmpp-c66a4d4097a249efc029b761d6150378a54bf702.tar.gz
slixmpp-c66a4d4097a249efc029b761d6150378a54bf702.tar.bz2
slixmpp-c66a4d4097a249efc029b761d6150378a54bf702.tar.xz
slixmpp-c66a4d4097a249efc029b761d6150378a54bf702.zip
Update the documentation and examples
- update most of the examples with slixmpp - change the help channels pointed out in the doc - add a page listing differences from slixmpp and how to use asyncio nicely with slixmpp - fix some in-code rst documentation
Diffstat (limited to 'docs/create_plugin.rst')
-rw-r--r--docs/create_plugin.rst25
1 files changed, 14 insertions, 11 deletions
diff --git a/docs/create_plugin.rst b/docs/create_plugin.rst
index db3b4f0f..9bfb053f 100644
--- a/docs/create_plugin.rst
+++ b/docs/create_plugin.rst
@@ -634,8 +634,9 @@ with some additional registration fields implemented.
if self.backend.register(iq['from'].bare, iq['register']):
# Successful registration
self.xmpp.event('registered_user', iq)
- iq.reply().set_payload(iq['register'].xml)
- iq.send()
+ reply = iq.reply()
+ reply.set_payload(iq['register'].xml)
+ reply.send()
else:
# Conflicting registration
self._sendError(iq, '409', 'cancel', 'conflict',
@@ -666,14 +667,16 @@ with some additional registration fields implemented.
# Add a blank field
reg.addField(field)
- iq.reply().set_payload(reg.xml)
- iq.send()
+ reply = iq.reply()
+ reply.set_payload(reg.xml)
+ reply.send()
def _sendError(self, iq, code, error_type, name, text=''):
- iq.reply().set_payload(iq['register'].xml)
- iq.error()
- iq['error']['code'] = code
- iq['error']['type'] = error_type
- iq['error']['condition'] = name
- iq['error']['text'] = text
- iq.send()
+ reply = iq.reply()
+ reply.set_payload(iq['register'].xml)
+ reply.error()
+ reply['error']['code'] = code
+ reply['error']['type'] = error_type
+ reply['error']['condition'] = name
+ reply['error']['text'] = text
+ reply.send()