mirror of https://gitlab.com/bashrc2/epicyon
Avoid confusion between xmpp and matrix addresses
parent
a5efcd3836
commit
7e03a33d33
|
@ -40,6 +40,10 @@ def get_matrix_address(actor_json: {}) -> str:
|
||||||
if not property_value['type'].endswith('PropertyValue'):
|
if not property_value['type'].endswith('PropertyValue'):
|
||||||
continue
|
continue
|
||||||
address_text = property_value[prop_value_name]
|
address_text = property_value[prop_value_name]
|
||||||
|
if 'xmpp' in address_text.lower():
|
||||||
|
continue
|
||||||
|
if 'jabber' in address_text.lower():
|
||||||
|
continue
|
||||||
if 'matrix' in address_text:
|
if 'matrix' in address_text:
|
||||||
address_text = address_text.split('matrix')[1]
|
address_text = address_text.split('matrix')[1]
|
||||||
elif 'Matrix' in address_text:
|
elif 'Matrix' in address_text:
|
||||||
|
|
16
xmpp.py
16
xmpp.py
|
@ -40,14 +40,18 @@ def get_xmpp_address(actor_json: {}) -> str:
|
||||||
if not property_value['type'].endswith('PropertyValue') and \
|
if not property_value['type'].endswith('PropertyValue') and \
|
||||||
not property_value['type'] == 'Link':
|
not property_value['type'] == 'Link':
|
||||||
continue
|
continue
|
||||||
if '@' not in property_value[prop_value_name]:
|
address_text = property_value[prop_value_name]
|
||||||
|
if 'matrix' in address_text.lower():
|
||||||
continue
|
continue
|
||||||
if '"' in property_value[prop_value_name]:
|
if '@' not in address_text:
|
||||||
continue
|
continue
|
||||||
if property_value[prop_value_name].startswith('xmpp://'):
|
if '.' not in address_text:
|
||||||
property_value[prop_value_name] = \
|
continue
|
||||||
property_value[prop_value_name].split('xmpp://', 1)[1]
|
if '"' in address_text:
|
||||||
return remove_html(property_value[prop_value_name])
|
continue
|
||||||
|
if address_text.startswith('xmpp://'):
|
||||||
|
address_text = address_text.split('xmpp://', 1)[1]
|
||||||
|
return remove_html(address_text)
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue