Mercurial > libervia-backend
diff src/plugins/plugin_xep_0277.py @ 1679:9ff4f60de005
plugin XEP-0277: use bare JIDs to verify publisher
author | souliane <souliane@mailoo.org> |
---|---|
date | Wed, 25 Nov 2015 17:19:25 +0100 |
parents | 1895846fc9cb |
children | 1e06a0f8be66 |
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0277.py Wed Nov 25 16:59:13 2015 +0100 +++ b/src/plugins/plugin_xep_0277.py Wed Nov 25 17:19:25 2015 +0100 @@ -302,10 +302,10 @@ 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: