comparison src/plugins/plugin_xep_0033.py @ 785:ff9a52077b36

plugin XEP-0033: the comparison for auto-fixing for the stanza recipient was not correct
author souliane <souliane@mailoo.org>
date Sun, 05 Jan 2014 13:00:17 +0100
parents bfabeedbf32e
children dd656d745d6a
comparison
equal deleted inserted replaced
784:900987e1c0c4 785:ff9a52077b36
84 return mess_data 84 return mess_data
85 85
86 def discoCallback(entity): 86 def discoCallback(entity):
87 if entity is None: 87 if entity is None:
88 return Failure(AbortSendMessage(_("XEP-0033 is being used but the server doesn't support it!"))) 88 return Failure(AbortSendMessage(_("XEP-0033 is being used but the server doesn't support it!")))
89 to = JID(mess_data["to"].host) 89 if mess_data["to"] != entity:
90 if to != entity: 90 logging.warning(_("Stanzas using XEP-0033 should be addressed to %s, not %s!") % (entity, mess_data["to"]))
91 logging.warning(_("Stanzas using XEP-0033 should be addressed to %s, not %s!") % (entity, to))
92 logging.warning(_("TODO: addressing has be fixed by the backend... fix it in the frontend!")) 91 logging.warning(_("TODO: addressing has be fixed by the backend... fix it in the frontend!"))
93 mess_data["to"] = entity 92 mess_data["to"] = entity
94 element = mess_data['xml'].addElement('addresses', NS_ADDRESS) 93 element = mess_data['xml'].addElement('addresses', NS_ADDRESS)
95 entries = [entry.split(':') for entry in mess_data['extra']['address'].split('\n') if entry != ''] 94 entries = [entry.split(':') for entry in mess_data['extra']['address'].split('\n') if entry != '']
96 for type_, jid_ in entries: 95 for type_, jid_ in entries: