summaryrefslogtreecommitdiff
path: root/sleekxmpp/stanza/message.py
diff options
context:
space:
mode:
Diffstat (limited to 'sleekxmpp/stanza/message.py')
-rw-r--r--sleekxmpp/stanza/message.py9
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