From a4fd7cb0dea4d7d58959e88b03c84286d3b5348f Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 15 Aug 2024 22:34:19 +0100 Subject: [PATCH] Detecting matrix addresses --- matrix.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/matrix.py b/matrix.py index 197faa605..8d3b79996 100644 --- a/matrix.py +++ b/matrix.py @@ -31,6 +31,9 @@ def get_matrix_address(actor_json: {}) -> str: if not name_value_lower.startswith('matrix'): if not name_value_lower.startswith('chat'): continue + if 'xmpp' in name_value_lower or \ + 'jabber' in name_value_lower: + continue if not property_value.get('type'): continue prop_value_name, _ = \ @@ -48,9 +51,8 @@ def get_matrix_address(actor_json: {}) -> str: address_text = address_text.split('matrix')[1] elif 'Matrix' in address_text: address_text = address_text.split('Matrix')[1] - if '@' not in address_text: - continue - address_text = '@' + address_text.split('@', 1)[1] + if '@' in address_text: + address_text = '@' + address_text.split('@', 1)[1] if ' ' in address_text: address_text = address_text.split(' ')[0] if '|' in address_text: