comparison src/plugins/plugin_xep_0047.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 7b0fcefd52d4
comparison
equal deleted inserted replaced
1408:8a7145138330 1409:3265a2639182
141 open_elt = IQ.firstChildElement() 141 open_elt = IQ.firstChildElement()
142 block_size = open_elt.getAttribute('block-size') 142 block_size = open_elt.getAttribute('block-size')
143 sid = open_elt.getAttribute('sid') 143 sid = open_elt.getAttribute('sid')
144 stanza = open_elt.getAttribute('stanza', 'iq') 144 stanza = open_elt.getAttribute('stanza', 'iq')
145 if not sid or not block_size or int(block_size) > 65535: 145 if not sid or not block_size or int(block_size) > 65535:
146 log.warning(_("malformed IBB transfer: %s" % IQ['id'])) 146 log.warning(_(u"malformed IBB transfer: %s" % IQ['id']))
147 self.sendNotAcceptableError(IQ['id'], IQ['from'], client.xmlstream) 147 self.sendNotAcceptableError(IQ['id'], IQ['from'], client.xmlstream)
148 return 148 return
149 if not sid in client.xep_0047_current_stream: 149 if not sid in client.xep_0047_current_stream:
150 log.warning(_("Ignoring unexpected IBB transfer: %s" % sid)) 150 log.warning(_(u"Ignoring unexpected IBB transfer: %s" % sid))
151 self.sendNotAcceptableError(IQ['id'], IQ['from'], client.xmlstream) 151 self.sendNotAcceptableError(IQ['id'], IQ['from'], client.xmlstream)
152 return 152 return
153 if client.xep_0047_current_stream[sid]["from"] != jid.JID(IQ['from']): 153 if client.xep_0047_current_stream[sid]["from"] != jid.JID(IQ['from']):
154 log.warning(_("sended jid inconsistency (man in the middle attack attempt ?)")) 154 log.warning(_("sended jid inconsistency (man in the middle attack attempt ?)"))
155 self.sendNotAcceptableError(IQ['id'], IQ['from'], client.xmlstream) 155 self.sendNotAcceptableError(IQ['id'], IQ['from'], client.xmlstream)