plugin XEP-0277: fixed comments URLs parsing
This commit is contained in:
parent
7f66a2f154
commit
9c84e5dcab
2 changed files with 5 additions and 7 deletions
|
|
@ -1128,10 +1128,8 @@ class XEP_0060(object):
|
|||
"""
|
||||
items, metadata = items_data
|
||||
|
||||
def eb(failure):
|
||||
log.warning(
|
||||
"Error while serialising/parsing item: {}".format(str(failure.value))
|
||||
)
|
||||
def eb(failure_):
|
||||
log.warning(f"Error while serialising/parsing item: {failure_.value}")
|
||||
|
||||
d = defer.gatherResults([item_cb(item).addErrback(eb) for item in items])
|
||||
|
||||
|
|
|
|||
|
|
@ -365,8 +365,8 @@ class XEP_0277(object):
|
|||
microblog_data[key] = link_elt["href"]
|
||||
try:
|
||||
service, node = self.parseCommentUrl(microblog_data[key])
|
||||
except:
|
||||
log.warning("Can't parse url {}".format(microblog_data[key]))
|
||||
except Exception as e:
|
||||
log.warning(f"Can't parse url {microblog_data[key]}: {e}")
|
||||
del microblog_data[key]
|
||||
else:
|
||||
microblog_data["{}_service".format(key)] = service.full()
|
||||
|
|
@ -853,7 +853,7 @@ class XEP_0277(object):
|
|||
"""
|
||||
parsed_url = urllib.parse.urlparse(node_url, "xmpp")
|
||||
service = jid.JID(parsed_url.path)
|
||||
parsed_queries = urllib.parse.parse_qs(parsed_url.query.encode("utf-8"))
|
||||
parsed_queries = urllib.parse.parse_qs(parsed_url.query)
|
||||
node = parsed_queries.get("node", [""])[0]
|
||||
|
||||
if not node:
|
||||
|
|
|
|||
Loading…
Reference in a new issue