# HG changeset patch # User Goffi # Date 1448472274 -3600 # Node ID c6c8350466813a9c838bfb39d447fd95a9e643f1 # Parent 1e06a0f8be66c9a3cbc6b8f431fbffd2b0b1ccaa plugin XEP-0277: minor fixes for publisher attribute diff -r 1e06a0f8be66 -r c6c835046681 src/plugins/plugin_xep_0277.py --- a/src/plugins/plugin_xep_0277.py Wed Nov 25 18:24:30 2015 +0100 +++ b/src/plugins/plugin_xep_0277.py Wed Nov 25 18:24:34 2015 +0100 @@ -271,12 +271,12 @@ log.warning(u"Unmanaged link element: rel={rel} title={title} href={href}".format(rel=rel, title=title, href=href)) # author - publisher = item_elt.getAttribute("publisher") try: author_elt = entry_elt.elements(NS_ATOM, 'author').next() except StopIteration: log.debug(u"Can't find author element in item {}".format(id_)) else: + publisher = item_elt.getAttribute("publisher") # name try: name_elt = author_elt.elements(NS_ATOM, 'name').next() @@ -302,7 +302,7 @@ if not publisher: log.debug(u"No publisher attribute, we can't verify author jid") 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 else: log.warning(u"item atom:uri differ from publisher attribute, spoofing attempt ? atom:uri = {} publisher = {}".format(uri, item_elt.getAttribute("publisher")))