plugin XEP-0277: minor fixes for publisher attribute
This commit is contained in:
parent
e78b225922
commit
2fdfc5220f
1 changed files with 2 additions and 2 deletions
|
|
@ -271,12 +271,12 @@ class XEP_0277(object):
|
||||||
log.warning(u"Unmanaged link element: rel={rel} title={title} href={href}".format(rel=rel, title=title, href=href))
|
log.warning(u"Unmanaged link element: rel={rel} title={title} href={href}".format(rel=rel, title=title, href=href))
|
||||||
|
|
||||||
# author
|
# author
|
||||||
publisher = item_elt.getAttribute("publisher")
|
|
||||||
try:
|
try:
|
||||||
author_elt = entry_elt.elements(NS_ATOM, 'author').next()
|
author_elt = entry_elt.elements(NS_ATOM, 'author').next()
|
||||||
except StopIteration:
|
except StopIteration:
|
||||||
log.debug(u"Can't find author element in item {}".format(id_))
|
log.debug(u"Can't find author element in item {}".format(id_))
|
||||||
else:
|
else:
|
||||||
|
publisher = item_elt.getAttribute("publisher")
|
||||||
# name
|
# name
|
||||||
try:
|
try:
|
||||||
name_elt = author_elt.elements(NS_ATOM, 'name').next()
|
name_elt = author_elt.elements(NS_ATOM, 'name').next()
|
||||||
|
|
@ -302,7 +302,7 @@ class XEP_0277(object):
|
||||||
if not publisher:
|
if not publisher:
|
||||||
log.debug(u"No publisher attribute, we can't verify author jid")
|
log.debug(u"No publisher attribute, we can't verify author jid")
|
||||||
microblog_data['author_jid_verified'] = C.BOOL_FALSE
|
microblog_data['author_jid_verified'] = C.BOOL_FALSE
|
||||||
elif publisher.split("/")[0] == uri.split("/")[0]:
|
elif jid.JID(publisher).userhostJID() == jid.JID(uri).userhostJID():
|
||||||
microblog_data['author_jid_verified'] = C.BOOL_TRUE
|
microblog_data['author_jid_verified'] = C.BOOL_TRUE
|
||||||
else:
|
else:
|
||||||
log.warning(u"item atom:uri differ from publisher attribute, spoofing attempt ? atom:uri = {} publisher = {}".format(uri, item_elt.getAttribute("publisher")))
|
log.warning(u"item atom:uri differ from publisher attribute, spoofing attempt ? atom:uri = {} publisher = {}".format(uri, item_elt.getAttribute("publisher")))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue