core (xmpp): parse <thread> element:
<thread> were generated from message data, but not parsed for incoming messages. rel 457
This commit is contained in:
parent
c008b65e63
commit
57f879f2d3
1 changed files with 12 additions and 4 deletions
|
|
@ -1333,7 +1333,7 @@ class SatMessageProtocol(xmppim.MessageProtocol):
|
|||
)
|
||||
)
|
||||
)
|
||||
return {}
|
||||
return MessageData()
|
||||
|
||||
if message_elt.uri == None:
|
||||
# xmlns may be None when wokkel element parsing strip out root namespace
|
||||
|
|
@ -1355,7 +1355,7 @@ class SatMessageProtocol(xmppim.MessageProtocol):
|
|||
message = {}
|
||||
subject = {}
|
||||
extra = {}
|
||||
data: MessageData = {
|
||||
data = MessageData({
|
||||
"from": jid.JID(message_elt["from"]),
|
||||
"to": jid.JID(message_elt["to"]),
|
||||
"uid": message_elt.getAttribute(
|
||||
|
|
@ -1365,10 +1365,10 @@ class SatMessageProtocol(xmppim.MessageProtocol):
|
|||
"subject": subject,
|
||||
"type": message_elt.getAttribute("type", "normal"),
|
||||
"extra": extra,
|
||||
}
|
||||
})
|
||||
|
||||
try:
|
||||
message_id = data["extra"]["message_id"] = message_elt["id"]
|
||||
message_id = extra["message_id"] = message_elt["id"]
|
||||
except KeyError:
|
||||
pass
|
||||
else:
|
||||
|
|
@ -1382,6 +1382,14 @@ class SatMessageProtocol(xmppim.MessageProtocol):
|
|||
for e in message_elt.elements(C.NS_CLIENT, "subject"):
|
||||
subject[e.getAttribute((C.NS_XML, "lang"), "")] = str(e)
|
||||
|
||||
# thread
|
||||
for e in message_elt.elements(C.NS_CLIENT, "thread"):
|
||||
extra["thread"] = str(e)
|
||||
if e.hasAttribute("parent"):
|
||||
extra["thread_parent"] = e["parent"]
|
||||
# Per RFC, we can't have more than one <thread>.
|
||||
break
|
||||
|
||||
# delay and timestamp
|
||||
try:
|
||||
received_timestamp = message_elt._received_timestamp
|
||||
|
|
|
|||
Loading…
Reference in a new issue