plugin XEP-0277: be sure to have an author_jid set
This commit is contained in:
parent
69112bcd79
commit
a2e79b0c28
1 changed files with 9 additions and 7 deletions
|
|
@ -420,13 +420,6 @@ class XEP_0277(object):
|
|||
author_elt = next(entry_elt.elements(NS_ATOM, "author"))
|
||||
except StopIteration:
|
||||
log.debug("Can't find author element in item {}".format(id_))
|
||||
if publisher:
|
||||
microblog_data["author_jid"] = publisher
|
||||
microblog_data["author_jid_verified"] = True
|
||||
else:
|
||||
iq_elt = xml_tools.findAncestor(item_elt, "iq", C.NS_CLIENT)
|
||||
microblog_data["author_jid"] = iq_elt["from"]
|
||||
microblog_data["author_jid_verified"] = False
|
||||
else:
|
||||
# name
|
||||
try:
|
||||
|
|
@ -477,6 +470,15 @@ class XEP_0277(object):
|
|||
else:
|
||||
microblog_data["author_email"] = str(email_elt)
|
||||
|
||||
if not microblog_data.get("author_jid"):
|
||||
if publisher:
|
||||
microblog_data["author_jid"] = publisher
|
||||
microblog_data["author_jid_verified"] = True
|
||||
else:
|
||||
iq_elt = xml_tools.findAncestor(item_elt, "iq", C.NS_CLIENT)
|
||||
microblog_data["author_jid"] = iq_elt["from"]
|
||||
microblog_data["author_jid_verified"] = False
|
||||
|
||||
# categories
|
||||
categories = [
|
||||
category_elt.getAttribute("term", "")
|
||||
|
|
|
|||
Loading…
Reference in a new issue