main
Bob Mottram 2022-12-10 11:05:03 +00:00
parent 9c60961a6e
commit ed89a95cb5
1 changed files with 5 additions and 13 deletions

View File

@ -10,6 +10,7 @@ __module_group__ = "Core"
import os import os
import time import time
import random import random
from utils import get_full_domain
from utils import acct_dir from utils import acct_dir
from utils import is_account_dir from utils import is_account_dir
from utils import get_nickname_from_actor from utils import get_nickname_from_actor
@ -84,6 +85,8 @@ def _update_import_following(base_dir: str,
# don't follow yourself # don't follow yourself
continue continue
following_handle = following_nickname + '@' + following_domain following_handle = following_nickname + '@' + following_domain
following_handle_full = following_nickname + '@' + \
get_full_domain(following_domain, following_port)
if notes: if notes:
notes = notes.replace('<br>', '\n') notes = notes.replace('<br>', '\n')
person_notes_filename = \ person_notes_filename = \
@ -96,8 +99,8 @@ def _update_import_following(base_dir: str,
except OSError: except OSError:
print('EX: Unable to import notes for ' + print('EX: Unable to import notes for ' +
following_handle) following_handle)
if is_following_actor(base_dir, if is_following_actor(base_dir, nickname, domain,
nickname, domain, following_handle): following_handle_full):
# remove the followed handle from the import list # remove the followed handle from the import list
following_str = following_str.replace(orig_line + '\n', '') following_str = following_str.replace(orig_line + '\n', '')
try: try:
@ -114,17 +117,6 @@ def _update_import_following(base_dir: str,
curr_port = httpd.port curr_port = httpd.port
curr_http_prefix = httpd.http_prefix curr_http_prefix = httpd.http_prefix
following_actor = following_handle following_actor = following_handle
if ':' in following_domain:
following_domain = following_domain.split(':')[0]
following_port = following_handle.split(':')[1]
if following_port.isdigit():
following_port = int(following_port)
else:
if following_domain.endswith('.onion') or \
following_domain.endswith('.i2p'):
following_port = 80
else:
following_port = 443
# get the appropriate session # get the appropriate session
curr_session = main_session curr_session = main_session