mirror of https://gitlab.com/bashrc2/epicyon
Change onion/i2p domains to local clearnet domain for incoming posts
parent
4567ec17f0
commit
cd5229efc5
12
inbox.py
12
inbox.py
|
@ -3299,6 +3299,18 @@ def _inbox_after_initial(recent_posts_cache: {}, max_recent_posts: int,
|
||||||
languages_understood: []) -> bool:
|
languages_understood: []) -> bool:
|
||||||
""" Anything which needs to be done after initial checks have passed
|
""" Anything which needs to be done after initial checks have passed
|
||||||
"""
|
"""
|
||||||
|
# if this is a clearnet instance then replace any onion/i2p
|
||||||
|
# domains with the account domain
|
||||||
|
message_str = json.dumps(message_json, ensure_ascii=False)
|
||||||
|
if onion_domain:
|
||||||
|
if onion_domain in message_str:
|
||||||
|
message_str = message_str.replace(onion_domain, domain)
|
||||||
|
message_json = json.loads(message_str)
|
||||||
|
if i2p_domain:
|
||||||
|
if i2p_domain in message_str:
|
||||||
|
message_str = message_str.replace(i2p_domain, domain)
|
||||||
|
message_json = json.loads(message_str)
|
||||||
|
|
||||||
actor = key_id
|
actor = key_id
|
||||||
if '#' in actor:
|
if '#' in actor:
|
||||||
actor = key_id.split('#')[0]
|
actor = key_id.split('#')[0]
|
||||||
|
|
Loading…
Reference in New Issue