* added tests

This commit is contained in:
Nathan Fritz
2010-01-08 07:01:19 +00:00
parent 137ef61523
commit 218c7318e0
5 changed files with 115 additions and 27 deletions

View File

@@ -4,7 +4,7 @@ from . error import Error
from . rootstanza import RootStanza
class Message(RootStanza):
interfaces = set(('type', 'to', 'from', 'id', 'body', 'subject'))
interfaces = set(('type', 'to', 'from', 'id', 'body', 'subject', 'groupchat'))
types = set((None, 'normal', 'chat', 'headline', 'error', 'groupchat'))
sub_interfaces = set(('body', 'subject'))
name = 'message'
@@ -23,6 +23,8 @@ class Message(RootStanza):
def reply(self, body=None):
StanzaBase.reply(self)
if self['type'] == 'groupchat':
self['to'] = self['to'].bare
del self['id']
if body is not None:
self['body'] = body