plugin XEP-0277: use bare JIDs to verify publisher

This commit is contained in:
souliane 2015-11-25 17:19:25 +01:00
commit 8181d8c08c

View file

@ -302,10 +302,10 @@ class XEP_0277(object):
if not publisher:
log.debug("No publisher attribute, we can't verify author jid")
microblog_data['author_jid_verified'] = C.BOOL_FALSE
elif publisher == uri:
elif publisher.split("/")[0] == uri.split("/")[0]:
microblog_data['author_jid_verified'] = C.BOOL_TRUE
else:
log.warning("item atom:uri differ from publisher attribute, spoofing attempt ? atom:uri = {} publisher = {}".format(uri, item_elt.getAttribute("publisher")))
log.warning("item atom:uri differs from publisher attribute: spoofing attempt? atom:uri = {} publisher = {}".format(uri, item_elt.getAttribute("publisher")))
microblog_data['author_jid_verified'] = C.BOOL_FALSE
# email
try: