Change domain for outgoing posts

main
Bob Mottram 2022-03-14 12:06:14 +00:00
parent d37e6d2b38
commit a9ac148e42
1 changed files with 10 additions and 4 deletions

View File

@ -2860,11 +2860,17 @@ def send_signed_json(post_json_object: {}, session, base_dir: str,
# if the sender domain has changed from clearnet to onion or i2p
# then change the content of the post accordingly
if account_domain != origin_domain:
if not origin_domain.endswith('.onion') and \
not origin_domain.endswith('.i2p'):
if debug:
print('Checking for changed origin domain: ' +
domain + ' ' + curr_domain)
if domain != curr_domain:
if not curr_domain.endswith('.onion') and \
not curr_domain.endswith('.i2p'):
if debug:
print('Changing post content sender domain from ' +
curr_domain + ' to ' + domain)
post_json_str = \
post_json_str.replace(origin_domain, account_domain)
post_json_str.replace(curr_domain, domain)
# construct the http header, including the message body digest
signature_header_json = \