comparison sat/core/xmpp.py @ 2979:f44a95f566d2

core, plugin XEP-0045: fix crashes when changing URIs: When adding missing URIs in message, the "children" property was used instead of elements(). "children" not only return elements, and this was causing crashes. This may fix bug 294 rel 294
author Goffi <goffi@goffi.org>
date Sun, 30 Jun 2019 15:52:30 +0200
parents d1fcb8e9aced
children 97a1faca8f58
comparison
equal deleted inserted replaced
2978:bad0b4280b77 2979:f44a95f566d2
967 return {} 967 return {}
968 968
969 if message_elt.uri is None: 969 if message_elt.uri is None:
970 # wokkel element parsing strip out root namespace 970 # wokkel element parsing strip out root namespace
971 message_elt.defaultUri = message_elt.uri = C.NS_CLIENT 971 message_elt.defaultUri = message_elt.uri = C.NS_CLIENT
972 for c in message_elt.children: 972 for c in message_elt.elements():
973 if c.uri is None: 973 if c.uri is None:
974 c.uri == C.NS_CLIENT 974 c.uri == C.NS_CLIENT
975 elif message_elt.uri != C.NS_CLIENT: 975 elif message_elt.uri != C.NS_CLIENT:
976 log.warning(_( 976 log.warning(_(
977 u"received <message> with a wrong namespace: {xml}" 977 u"received <message> with a wrong namespace: {xml}"