test: added tests for XEP-0033
This commit is contained in:
parent
96b1d58eb7
commit
84bfd205dd
1 changed files with 175 additions and 6 deletions
|
|
@ -96,7 +96,7 @@ class XEP_0033(object):
|
|||
element.addChild(domish.Element((None, 'address'), None, {'type': type_, 'jid': jid_}))
|
||||
# when the prosody plugin is completed, we can immediately return mess_data from here
|
||||
self.sendAndStoreMessage(mess_data, entries, profile)
|
||||
return Failure(MessageSentAndStored("XEP-0033 took over"))
|
||||
return Failure(MessageSentAndStored("XEP-0033 took over", mess_data))
|
||||
d = self.host.requestServerDisco(NS_ADDRESS, profile_key=profile)
|
||||
d.addCallbacks(discoCallback, lambda dummy: discoCallback(None))
|
||||
return d
|
||||
|
|
@ -151,7 +151,10 @@ class XEP_0033(object):
|
|||
def post_treat_addr(data, addresses):
|
||||
data['extra']['addresses'] = ""
|
||||
for address in addresses:
|
||||
data['extra']['addresses'] += '%s:%s\n' % (address['type'], address['jid'])
|
||||
# Depending how message has been constructed, we could get here
|
||||
# some noise like "\n " instead of an address element.
|
||||
if isinstance(address, domish.Element):
|
||||
data['extra']['addresses'] += '%s:%s\n' % (address['type'], address['jid'])
|
||||
return data
|
||||
|
||||
try:
|
||||
|
|
|
|||
Loading…
Reference in a new issue