diff options
author | Nathan Fritz <fritzy@netflint.net> | 2009-12-17 01:54:22 +0000 |
---|---|---|
committer | Nathan Fritz <fritzy@netflint.net> | 2009-12-17 01:54:22 +0000 |
commit | 07018c0afa7485b06424bf6787d242e7ee523d34 (patch) | |
tree | 5de2ae3309eb439b96d4dc5ce62abf00597f75f3 /sleekxmpp/stanza/message.py | |
parent | 6897a0b57c299cff9e32fde4dcb4209e70fb4bcb (diff) | |
download | slixmpp-07018c0afa7485b06424bf6787d242e7ee523d34.tar.gz slixmpp-07018c0afa7485b06424bf6787d242e7ee523d34.tar.bz2 slixmpp-07018c0afa7485b06424bf6787d242e7ee523d34.tar.xz slixmpp-07018c0afa7485b06424bf6787d242e7ee523d34.zip |
* fixed many stanza bugs
* added stanza unhandled (unhandled iqs now reply with feature-not-implemented)
* added stanza exceptions (stanzas may now reply with exceptions when their handler raises an exception)
Diffstat (limited to 'sleekxmpp/stanza/message.py')
-rw-r--r-- | sleekxmpp/stanza/message.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sleekxmpp/stanza/message.py b/sleekxmpp/stanza/message.py index 999f7924..d75421c8 100644 --- a/sleekxmpp/stanza/message.py +++ b/sleekxmpp/stanza/message.py @@ -4,7 +4,7 @@ from . error import Error class Message(StanzaBase): interfaces = set(('type', 'to', 'from', 'id', 'body', 'subject')) - types = set((None, 'normal', 'chat', 'headline', 'error')) + types = set((None, 'normal', 'chat', 'headline', 'error', 'groupchat')) sub_interfaces = set(('body', 'subject')) name = 'message' namespace = 'jabber:client' @@ -22,9 +22,16 @@ class Message(StanzaBase): def reply(self, body=None): StanzaBase.reply(self) + del self['id'] if body is not None: self['body'] = body return self + def exception(self, text): + self.reply() + self['error']['condition'] = 'undefined-condition' + self['error']['text'] = text + self.send() + Message.plugin_attrib_map['error'] = Error Message.plugin_tag_map["{%s}%s" % (Error.namespace, Error.name)] = Error |