mirror of https://gitlab.com/bashrc2/epicyon
Deprecate jami
It turns out that it's based on the Etherium blockchain, and I hadn't realized this for a number of years.merge-requests/30/head
parent
9438e27cdf
commit
eab1e3a41d
18
daemon.py
18
daemon.py
|
@ -49,8 +49,6 @@ from tox import get_tox_address
|
||||||
from tox import set_tox_address
|
from tox import set_tox_address
|
||||||
from briar import get_briar_address
|
from briar import get_briar_address
|
||||||
from briar import set_briar_address
|
from briar import set_briar_address
|
||||||
from jami import get_jami_address
|
|
||||||
from jami import set_jami_address
|
|
||||||
from cwtch import get_cwtch_address
|
from cwtch import get_cwtch_address
|
||||||
from cwtch import set_cwtch_address
|
from cwtch import set_cwtch_address
|
||||||
from matrix import get_matrix_address
|
from matrix import get_matrix_address
|
||||||
|
@ -5946,18 +5944,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
set_briar_address(actor_json, '')
|
set_briar_address(actor_json, '')
|
||||||
actor_changed = True
|
actor_changed = True
|
||||||
|
|
||||||
# change jami address
|
|
||||||
current_jami_address = get_jami_address(actor_json)
|
|
||||||
if fields.get('jamiAddress'):
|
|
||||||
if fields['jamiAddress'] != current_jami_address:
|
|
||||||
set_jami_address(actor_json,
|
|
||||||
fields['jamiAddress'])
|
|
||||||
actor_changed = True
|
|
||||||
else:
|
|
||||||
if current_jami_address:
|
|
||||||
set_jami_address(actor_json, '')
|
|
||||||
actor_changed = True
|
|
||||||
|
|
||||||
# change cwtch address
|
# change cwtch address
|
||||||
current_cwtch_address = get_cwtch_address(actor_json)
|
current_cwtch_address = get_cwtch_address(actor_json)
|
||||||
if fields.get('cwtchAddress'):
|
if fields.get('cwtchAddress'):
|
||||||
|
@ -7820,7 +7806,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
blog_address = None
|
blog_address = None
|
||||||
tox_address = None
|
tox_address = None
|
||||||
briar_address = None
|
briar_address = None
|
||||||
jami_address = None
|
|
||||||
cwtch_address = None
|
cwtch_address = None
|
||||||
ssb_address = None
|
ssb_address = None
|
||||||
email_address = None
|
email_address = None
|
||||||
|
@ -7849,7 +7834,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
blog_address = get_blog_address(actor_json)
|
blog_address = get_blog_address(actor_json)
|
||||||
tox_address = get_tox_address(actor_json)
|
tox_address = get_tox_address(actor_json)
|
||||||
briar_address = get_briar_address(actor_json)
|
briar_address = get_briar_address(actor_json)
|
||||||
jami_address = get_jami_address(actor_json)
|
|
||||||
cwtch_address = get_cwtch_address(actor_json)
|
cwtch_address = get_cwtch_address(actor_json)
|
||||||
email_address = get_email_address(actor_json)
|
email_address = get_email_address(actor_json)
|
||||||
enigma_pub_key = get_enigma_pub_key(actor_json)
|
enigma_pub_key = get_enigma_pub_key(actor_json)
|
||||||
|
@ -7899,7 +7883,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
xmpp_address, matrix_address,
|
xmpp_address, matrix_address,
|
||||||
ssb_address, blog_address,
|
ssb_address, blog_address,
|
||||||
tox_address, briar_address,
|
tox_address, briar_address,
|
||||||
jami_address, cwtch_address,
|
cwtch_address,
|
||||||
enigma_pub_key,
|
enigma_pub_key,
|
||||||
pgp_pub_key, pgp_fingerprint,
|
pgp_pub_key, pgp_fingerprint,
|
||||||
email_address,
|
email_address,
|
||||||
|
|
96
jami.py
96
jami.py
|
@ -1,96 +0,0 @@
|
||||||
__filename__ = "jami.py"
|
|
||||||
__author__ = "Bob Mottram"
|
|
||||||
__license__ = "AGPL3+"
|
|
||||||
__version__ = "1.3.0"
|
|
||||||
__maintainer__ = "Bob Mottram"
|
|
||||||
__email__ = "bob@libreserver.org"
|
|
||||||
__status__ = "Production"
|
|
||||||
__module_group__ = "Profile Metadata"
|
|
||||||
|
|
||||||
|
|
||||||
def get_jami_address(actor_json: {}) -> str:
|
|
||||||
"""Returns jami address for the given actor
|
|
||||||
"""
|
|
||||||
if not actor_json.get('attachment'):
|
|
||||||
return ''
|
|
||||||
for property_value in actor_json['attachment']:
|
|
||||||
if not property_value.get('name'):
|
|
||||||
continue
|
|
||||||
if not property_value['name'].lower().startswith('jami'):
|
|
||||||
continue
|
|
||||||
if not property_value.get('type'):
|
|
||||||
continue
|
|
||||||
if not property_value.get('value'):
|
|
||||||
continue
|
|
||||||
if property_value['type'] != 'PropertyValue':
|
|
||||||
continue
|
|
||||||
property_value['value'] = property_value['value'].strip()
|
|
||||||
if len(property_value['value']) < 2:
|
|
||||||
continue
|
|
||||||
if '"' in property_value['value']:
|
|
||||||
continue
|
|
||||||
if ' ' in property_value['value']:
|
|
||||||
continue
|
|
||||||
if ',' in property_value['value']:
|
|
||||||
continue
|
|
||||||
if '.' in property_value['value']:
|
|
||||||
continue
|
|
||||||
return property_value['value']
|
|
||||||
return ''
|
|
||||||
|
|
||||||
|
|
||||||
def set_jami_address(actor_json: {}, jami_address: str) -> None:
|
|
||||||
"""Sets an jami address for the given actor
|
|
||||||
"""
|
|
||||||
not_jami_address = False
|
|
||||||
|
|
||||||
if len(jami_address) < 2:
|
|
||||||
not_jami_address = True
|
|
||||||
if '"' in jami_address:
|
|
||||||
not_jami_address = True
|
|
||||||
if ' ' in jami_address:
|
|
||||||
not_jami_address = True
|
|
||||||
if '.' in jami_address:
|
|
||||||
not_jami_address = True
|
|
||||||
if ',' in jami_address:
|
|
||||||
not_jami_address = True
|
|
||||||
if '<' in jami_address:
|
|
||||||
not_jami_address = True
|
|
||||||
|
|
||||||
if not actor_json.get('attachment'):
|
|
||||||
actor_json['attachment'] = []
|
|
||||||
|
|
||||||
# remove any existing value
|
|
||||||
property_found = None
|
|
||||||
for property_value in actor_json['attachment']:
|
|
||||||
if not property_value.get('name'):
|
|
||||||
continue
|
|
||||||
if not property_value.get('type'):
|
|
||||||
continue
|
|
||||||
if not property_value['name'].lower().startswith('jami'):
|
|
||||||
continue
|
|
||||||
property_found = property_value
|
|
||||||
break
|
|
||||||
if property_found:
|
|
||||||
actor_json['attachment'].remove(property_found)
|
|
||||||
if not_jami_address:
|
|
||||||
return
|
|
||||||
|
|
||||||
for property_value in actor_json['attachment']:
|
|
||||||
if not property_value.get('name'):
|
|
||||||
continue
|
|
||||||
if not property_value.get('type'):
|
|
||||||
continue
|
|
||||||
if not property_value['name'].lower().startswith('jami'):
|
|
||||||
continue
|
|
||||||
if property_value['type'] != 'PropertyValue':
|
|
||||||
continue
|
|
||||||
property_value['value'] = jami_address
|
|
||||||
return
|
|
||||||
|
|
||||||
new_jami_address = {
|
|
||||||
"name": "Jami",
|
|
||||||
"type": "PropertyValue",
|
|
||||||
"value": jami_address
|
|
||||||
}
|
|
||||||
actor_json['attachment'].append(new_jami_address)
|
|
9
pgp.py
9
pgp.py
|
@ -24,7 +24,6 @@ from posts import get_person_box
|
||||||
from auth import create_basic_auth_header
|
from auth import create_basic_auth_header
|
||||||
from session import post_json
|
from session import post_json
|
||||||
from xmpp import get_xmpp_address
|
from xmpp import get_xmpp_address
|
||||||
from jami import get_jami_address
|
|
||||||
from matrix import get_matrix_address
|
from matrix import get_matrix_address
|
||||||
from briar import get_briar_address
|
from briar import get_briar_address
|
||||||
from cwtch import get_cwtch_address
|
from cwtch import get_cwtch_address
|
||||||
|
@ -657,9 +656,6 @@ def actor_to_vcard(actor: {}, domain: str) -> str:
|
||||||
xmpp_address = get_xmpp_address(actor)
|
xmpp_address = get_xmpp_address(actor)
|
||||||
if xmpp_address:
|
if xmpp_address:
|
||||||
vcard_str += 'IMPP:xmpp:' + xmpp_address + '\n'
|
vcard_str += 'IMPP:xmpp:' + xmpp_address + '\n'
|
||||||
jami_address = get_jami_address(actor)
|
|
||||||
if jami_address:
|
|
||||||
vcard_str += 'IMPP:jami:' + jami_address + '\n'
|
|
||||||
matrix_address = get_matrix_address(actor)
|
matrix_address = get_matrix_address(actor)
|
||||||
if matrix_address:
|
if matrix_address:
|
||||||
vcard_str += 'IMPP:matrix:' + matrix_address + '\n'
|
vcard_str += 'IMPP:matrix:' + matrix_address + '\n'
|
||||||
|
@ -710,11 +706,6 @@ def actor_to_vcard_xml(actor: {}, domain: str) -> str:
|
||||||
vcard_str += ' <impp>' + \
|
vcard_str += ' <impp>' + \
|
||||||
'<parameters><type><text>xmpp</text></type></parameters>' + \
|
'<parameters><type><text>xmpp</text></type></parameters>' + \
|
||||||
'<text>' + xmpp_address + '</text></impp>\n'
|
'<text>' + xmpp_address + '</text></impp>\n'
|
||||||
jami_address = get_jami_address(actor)
|
|
||||||
if jami_address:
|
|
||||||
vcard_str += ' <impp>' + \
|
|
||||||
'<parameters><type><text>jami</text></type></parameters>' + \
|
|
||||||
'<text>' + jami_address + '</text></impp>\n'
|
|
||||||
matrix_address = get_matrix_address(actor)
|
matrix_address = get_matrix_address(actor)
|
||||||
if matrix_address:
|
if matrix_address:
|
||||||
vcard_str += ' <impp>' + \
|
vcard_str += ' <impp>' + \
|
||||||
|
|
|
@ -47,7 +47,6 @@ def html_person_options(default_timeline: str,
|
||||||
blog_address: str,
|
blog_address: str,
|
||||||
tox_address: str,
|
tox_address: str,
|
||||||
briar_address: str,
|
briar_address: str,
|
||||||
jami_address: str,
|
|
||||||
cwtch_address: str,
|
cwtch_address: str,
|
||||||
enigma_pub_key: str,
|
enigma_pub_key: str,
|
||||||
pgp_pub_key: str,
|
pgp_pub_key: str,
|
||||||
|
@ -237,9 +236,6 @@ def html_person_options(default_timeline: str,
|
||||||
options_str += \
|
options_str += \
|
||||||
'<p class="imText">briar://' + \
|
'<p class="imText">briar://' + \
|
||||||
remove_html(briar_address) + '</p>\n'
|
remove_html(briar_address) + '</p>\n'
|
||||||
if jami_address:
|
|
||||||
options_str += \
|
|
||||||
'<p class="imText">Jami: ' + remove_html(jami_address) + '</p>\n'
|
|
||||||
if cwtch_address:
|
if cwtch_address:
|
||||||
options_str += \
|
options_str += \
|
||||||
'<p class="imText">Cwtch: ' + remove_html(cwtch_address) + '</p>\n'
|
'<p class="imText">Cwtch: ' + remove_html(cwtch_address) + '</p>\n'
|
||||||
|
|
|
@ -51,7 +51,6 @@ from pgp import get_pgp_pub_key
|
||||||
from enigma import get_enigma_pub_key
|
from enigma import get_enigma_pub_key
|
||||||
from tox import get_tox_address
|
from tox import get_tox_address
|
||||||
from briar import get_briar_address
|
from briar import get_briar_address
|
||||||
from jami import get_jami_address
|
|
||||||
from cwtch import get_cwtch_address
|
from cwtch import get_cwtch_address
|
||||||
from filters import is_filtered
|
from filters import is_filtered
|
||||||
from follow import is_follower_of_person
|
from follow import is_follower_of_person
|
||||||
|
@ -675,11 +674,10 @@ def html_profile(signing_priv_key_pem: str,
|
||||||
ssb_address = get_ssb_address(profile_json)
|
ssb_address = get_ssb_address(profile_json)
|
||||||
tox_address = get_tox_address(profile_json)
|
tox_address = get_tox_address(profile_json)
|
||||||
briar_address = get_briar_address(profile_json)
|
briar_address = get_briar_address(profile_json)
|
||||||
jami_address = get_jami_address(profile_json)
|
|
||||||
cwtch_address = get_cwtch_address(profile_json)
|
cwtch_address = get_cwtch_address(profile_json)
|
||||||
if donate_url or website_url or xmpp_address or matrix_address or \
|
if donate_url or website_url or xmpp_address or matrix_address or \
|
||||||
ssb_address or tox_address or briar_address or \
|
ssb_address or tox_address or briar_address or \
|
||||||
jami_address or cwtch_address or pgp_pub_key or enigma_pub_key or \
|
cwtch_address or pgp_pub_key or enigma_pub_key or \
|
||||||
pgp_fingerprint or email_address:
|
pgp_fingerprint or email_address:
|
||||||
donate_section = '<div class="container">\n'
|
donate_section = '<div class="container">\n'
|
||||||
donate_section += ' <center>\n'
|
donate_section += ' <center>\n'
|
||||||
|
@ -724,10 +722,6 @@ def html_profile(signing_priv_key_pem: str,
|
||||||
donate_section += \
|
donate_section += \
|
||||||
'<p>briar://<label class="toxaddr">' + \
|
'<p>briar://<label class="toxaddr">' + \
|
||||||
briar_address + '</label></p>\n'
|
briar_address + '</label></p>\n'
|
||||||
if jami_address:
|
|
||||||
donate_section += \
|
|
||||||
'<p>Jami: <label class="toxaddr">' + \
|
|
||||||
jami_address + '</label></p>\n'
|
|
||||||
if cwtch_address:
|
if cwtch_address:
|
||||||
donate_section += \
|
donate_section += \
|
||||||
'<p>Cwtch: <label class="toxaddr">' + \
|
'<p>Cwtch: <label class="toxaddr">' + \
|
||||||
|
@ -1941,7 +1935,6 @@ def _html_edit_profile_contact_info(nickname: str,
|
||||||
ssb_address: str,
|
ssb_address: str,
|
||||||
tox_address: str,
|
tox_address: str,
|
||||||
briar_address: str,
|
briar_address: str,
|
||||||
jami_address: str,
|
|
||||||
cwtch_address: str,
|
cwtch_address: str,
|
||||||
translate: {}) -> str:
|
translate: {}) -> str:
|
||||||
"""Contact Information section of edit profile screen
|
"""Contact Information section of edit profile screen
|
||||||
|
@ -1958,7 +1951,6 @@ def _html_edit_profile_contact_info(nickname: str,
|
||||||
edit_profile_form += edit_text_field('Tox', 'toxAddress', tox_address)
|
edit_profile_form += edit_text_field('Tox', 'toxAddress', tox_address)
|
||||||
edit_profile_form += edit_text_field('Briar', 'briarAddress',
|
edit_profile_form += edit_text_field('Briar', 'briarAddress',
|
||||||
briar_address)
|
briar_address)
|
||||||
edit_profile_form += edit_text_field('Jami', 'jamiAddress', jami_address)
|
|
||||||
edit_profile_form += edit_text_field('Cwtch', 'cwtchAddress',
|
edit_profile_form += edit_text_field('Cwtch', 'cwtchAddress',
|
||||||
cwtch_address)
|
cwtch_address)
|
||||||
edit_profile_form += \
|
edit_profile_form += \
|
||||||
|
@ -2208,7 +2200,7 @@ def html_edit_profile(server, css_cache: {}, translate: {},
|
||||||
bio_str = donate_url = website_url = email_address = ''
|
bio_str = donate_url = website_url = email_address = ''
|
||||||
pgp_pub_key = enigma_pub_key = ''
|
pgp_pub_key = enigma_pub_key = ''
|
||||||
pgp_fingerprint = xmpp_address = matrix_address = ''
|
pgp_fingerprint = xmpp_address = matrix_address = ''
|
||||||
ssb_address = blog_address = tox_address = jami_address = ''
|
ssb_address = blog_address = tox_address = ''
|
||||||
cwtch_address = briar_address = manually_approves_followers = ''
|
cwtch_address = briar_address = manually_approves_followers = ''
|
||||||
|
|
||||||
actor_json = load_json(actor_filename)
|
actor_json = load_json(actor_filename)
|
||||||
|
@ -2223,7 +2215,6 @@ def html_edit_profile(server, css_cache: {}, translate: {},
|
||||||
blog_address = get_blog_address(actor_json)
|
blog_address = get_blog_address(actor_json)
|
||||||
tox_address = get_tox_address(actor_json)
|
tox_address = get_tox_address(actor_json)
|
||||||
briar_address = get_briar_address(actor_json)
|
briar_address = get_briar_address(actor_json)
|
||||||
jami_address = get_jami_address(actor_json)
|
|
||||||
cwtch_address = get_cwtch_address(actor_json)
|
cwtch_address = get_cwtch_address(actor_json)
|
||||||
email_address = get_email_address(actor_json)
|
email_address = get_email_address(actor_json)
|
||||||
enigma_pub_key = get_enigma_pub_key(actor_json)
|
enigma_pub_key = get_enigma_pub_key(actor_json)
|
||||||
|
@ -2368,7 +2359,7 @@ def html_edit_profile(server, css_cache: {}, translate: {},
|
||||||
_html_edit_profile_contact_info(nickname, email_address,
|
_html_edit_profile_contact_info(nickname, email_address,
|
||||||
xmpp_address, matrix_address,
|
xmpp_address, matrix_address,
|
||||||
ssb_address, tox_address,
|
ssb_address, tox_address,
|
||||||
briar_address, jami_address,
|
briar_address,
|
||||||
cwtch_address, translate)
|
cwtch_address, translate)
|
||||||
|
|
||||||
# Encryption Keys
|
# Encryption Keys
|
||||||
|
|
|
@ -782,7 +782,7 @@ def html_header_with_person_markup(css_filename: str, instance_title: str,
|
||||||
if actor_json.get('attachment'):
|
if actor_json.get('attachment'):
|
||||||
og_tags = (
|
og_tags = (
|
||||||
'email', 'openpgp', 'blog', 'xmpp', 'matrix', 'briar',
|
'email', 'openpgp', 'blog', 'xmpp', 'matrix', 'briar',
|
||||||
'jami', 'cwtch', 'languages'
|
'cwtch', 'languages'
|
||||||
)
|
)
|
||||||
for attach_json in actor_json['attachment']:
|
for attach_json in actor_json['attachment']:
|
||||||
if not attach_json.get('name'):
|
if not attach_json.get('name'):
|
||||||
|
|
|
@ -406,7 +406,6 @@ def _webfinger_updateFromProfile(wf_json: {}, actor_json: {}) -> bool:
|
||||||
"ssb": "ssb",
|
"ssb": "ssb",
|
||||||
"briar": "briar",
|
"briar": "briar",
|
||||||
"cwtch": "cwtch",
|
"cwtch": "cwtch",
|
||||||
"jami": "jami",
|
|
||||||
"tox": "toxId"
|
"tox": "toxId"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue