core (xmpp): check <message> namespace in parseMessage, and accept empty namespace (happen with Wokkel)
This commit is contained in:
parent
6bb1b599ab
commit
7e79203fa0
1 changed files with 10 additions and 0 deletions
|
|
@ -839,6 +839,7 @@ class SatXMPPComponent(SatXMPPEntity, component.Component):
|
|||
|
||||
|
||||
class SatMessageProtocol(xmppim.MessageProtocol):
|
||||
|
||||
def __init__(self, host):
|
||||
xmppim.MessageProtocol.__init__(self)
|
||||
self.host = host
|
||||
|
|
@ -856,6 +857,15 @@ class SatMessageProtocol(xmppim.MessageProtocol):
|
|||
u"parseMessage used with a non <message/> stanza, ignoring: {xml}"
|
||||
.format(xml=message_elt.toXml())))
|
||||
return {}
|
||||
|
||||
if message_elt.uri is None:
|
||||
# wokkel element parsing strip out root namespace
|
||||
message_elt.uri = C.NS_CLIENT
|
||||
elif message_elt.uri != C.NS_CLIENT:
|
||||
log.warning(_(
|
||||
u"received <message> with a wrong namespace: {xml}"
|
||||
.format(xml=message_elt.toXml())))
|
||||
|
||||
client = self.parent
|
||||
message = {}
|
||||
subject = {}
|
||||
|
|
|
|||
Loading…
Reference in a new issue