Mercurial > libervia-backend
comparison src/plugins/plugin_xep_0033.py @ 1409:3265a2639182
massive (preventive) addition of 'u' (unicode) before the strings passed to logging functions
author | souliane <souliane@mailoo.org> |
---|---|
date | Thu, 16 Apr 2015 14:57:57 +0200 |
parents | 069ad98b360d |
children | e0bde0d0b321 |
comparison
equal
deleted
inserted
replaced
1408:8a7145138330 | 1409:3265a2639182 |
---|---|
86 if not entities: | 86 if not entities: |
87 log.warning(_("XEP-0033 is being used but the server doesn't support it!")) | 87 log.warning(_("XEP-0033 is being used but the server doesn't support it!")) |
88 raise failure.Failure(exceptions.CancelError()) | 88 raise failure.Failure(exceptions.CancelError()) |
89 if mess_data["to"] not in entities: | 89 if mess_data["to"] not in entities: |
90 expected = _(' or ').join([entity.userhost() for entity in entities]) | 90 expected = _(' or ').join([entity.userhost() for entity in entities]) |
91 log.warning(_("Stanzas using XEP-0033 should be addressed to %(expected)s, not %(current)s!") % {'expected': expected, 'current': mess_data["to"]}) | 91 log.warning(_(u"Stanzas using XEP-0033 should be addressed to %(expected)s, not %(current)s!") % {'expected': expected, 'current': mess_data["to"]}) |
92 log.warning(_("TODO: addressing has been fixed by the backend... fix it in the frontend!")) | 92 log.warning(_(u"TODO: addressing has been fixed by the backend... fix it in the frontend!")) |
93 mess_data["to"] = list(entities)[0].userhostJID() | 93 mess_data["to"] = list(entities)[0].userhostJID() |
94 element = mess_data['xml'].addElement('addresses', NS_ADDRESS) | 94 element = mess_data['xml'].addElement('addresses', NS_ADDRESS) |
95 entries = [entry.split(':') for entry in mess_data['extra']['address'].split('\n') if entry != ''] | 95 entries = [entry.split(':') for entry in mess_data['extra']['address'].split('\n') if entry != ''] |
96 for type_, jid_ in entries: | 96 for type_, jid_ in entries: |
97 element.addChild(domish.Element((None, 'address'), None, {'type': type_, 'jid': jid_})) | 97 element.addChild(domish.Element((None, 'address'), None, {'type': type_, 'jid': jid_})) |