From c66a4d4097a249efc029b761d6150378a54bf702 Mon Sep 17 00:00:00 2001 From: mathieui Date: Tue, 24 Feb 2015 18:58:40 +0100 Subject: 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 --- docs/create_plugin.rst | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'docs/create_plugin.rst') 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() -- cgit v1.2.3