mirror of https://gitlab.com/bashrc2/epicyon
Handling matrix addresses
parent
d26e172ee6
commit
a5efcd3836
|
@ -1,7 +1,6 @@
|
||||||
# Roadmap
|
# Roadmap
|
||||||
|
|
||||||
## UX
|
## UX
|
||||||
* Minimize button shows different icons or highlighting
|
|
||||||
* Layout of buttons on person options screen
|
* Layout of buttons on person options screen
|
||||||
|
|
||||||
## Groups
|
## Groups
|
||||||
|
@ -11,7 +10,6 @@
|
||||||
|
|
||||||
## Questions
|
## Questions
|
||||||
|
|
||||||
* Still not implemented ideally
|
|
||||||
* Instance-only questions
|
* Instance-only questions
|
||||||
* Active polls screen?
|
* Active polls screen?
|
||||||
* Questions more integrated into overall organization
|
* Questions more integrated into overall organization
|
||||||
|
|
28
matrix.py
28
matrix.py
|
@ -27,8 +27,10 @@ def get_matrix_address(actor_json: {}) -> str:
|
||||||
name_value = property_value['schema:name']
|
name_value = property_value['schema:name']
|
||||||
if not name_value:
|
if not name_value:
|
||||||
continue
|
continue
|
||||||
if not name_value.lower().startswith('matrix'):
|
name_value_lower = name_value.lower()
|
||||||
continue
|
if not name_value_lower.startswith('matrix'):
|
||||||
|
if not name_value_lower.startswith('chat'):
|
||||||
|
continue
|
||||||
if not property_value.get('type'):
|
if not property_value.get('type'):
|
||||||
continue
|
continue
|
||||||
prop_value_name, _ = \
|
prop_value_name, _ = \
|
||||||
|
@ -37,15 +39,25 @@ def get_matrix_address(actor_json: {}) -> str:
|
||||||
continue
|
continue
|
||||||
if not property_value['type'].endswith('PropertyValue'):
|
if not property_value['type'].endswith('PropertyValue'):
|
||||||
continue
|
continue
|
||||||
if '@' not in property_value[prop_value_name]:
|
address_text = property_value[prop_value_name]
|
||||||
|
if 'matrix' in address_text:
|
||||||
|
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
|
continue
|
||||||
if not property_value[prop_value_name].startswith('@'):
|
address_text = '@' + address_text.split('@', 1)[1]
|
||||||
|
if ' ' in address_text:
|
||||||
|
address_text = address_text.split(' ')[0]
|
||||||
|
if '|' in address_text:
|
||||||
|
address_text = address_text.split('|')[0]
|
||||||
|
if ',' in address_text:
|
||||||
|
address_text = address_text.split(',')[0]
|
||||||
|
if ':' not in address_text:
|
||||||
continue
|
continue
|
||||||
if ':' not in property_value[prop_value_name]:
|
if '"' in address_text:
|
||||||
continue
|
continue
|
||||||
if '"' in property_value[prop_value_name]:
|
return remove_html(address_text)
|
||||||
continue
|
|
||||||
return remove_html(property_value[prop_value_name])
|
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue