mirror of https://gitlab.com/bashrc2/epicyon
				
				
				
			Tidying
							parent
							
								
									967cd84ce7
								
							
						
					
					
						commit
						52a7cb0fa9
					
				
							
								
								
									
										37
									
								
								daemon.py
								
								
								
								
							
							
						
						
									
										37
									
								
								daemon.py
								
								
								
								
							| 
						 | 
				
			
			@ -2230,12 +2230,12 @@ class PubServer(BaseHTTPRequestHandler):
 | 
			
		|||
            moderation_text = None
 | 
			
		||||
            moderation_button = None
 | 
			
		||||
            # get the moderation text first
 | 
			
		||||
            actStr = 'moderationAction='
 | 
			
		||||
            act_str = 'moderationAction='
 | 
			
		||||
            for moderation_str in moderation_params.split('&'):
 | 
			
		||||
                if moderation_str.startswith(actStr):
 | 
			
		||||
                    if actStr in moderation_str:
 | 
			
		||||
                if moderation_str.startswith(act_str):
 | 
			
		||||
                    if act_str in moderation_str:
 | 
			
		||||
                        moderation_text = \
 | 
			
		||||
                            moderation_str.split(actStr)[1].strip()
 | 
			
		||||
                            moderation_str.split(act_str)[1].strip()
 | 
			
		||||
                        mod_text = moderation_text.replace('+', ' ')
 | 
			
		||||
                        moderation_text = \
 | 
			
		||||
                            urllib.parse.unquote_plus(mod_text.strip())
 | 
			
		||||
| 
						 | 
				
			
			@ -4672,7 +4672,7 @@ class PubServer(BaseHTTPRequestHandler):
 | 
			
		|||
            print('origin_path_str: ' + origin_path_str)
 | 
			
		||||
            print('remove_post_actor: ' + remove_post_actor)
 | 
			
		||||
            if origin_path_str in remove_post_actor:
 | 
			
		||||
                toList = [
 | 
			
		||||
                to_list = [
 | 
			
		||||
                    'https://www.w3.org/ns/activitystreams#Public',
 | 
			
		||||
                    remove_post_actor
 | 
			
		||||
                ]
 | 
			
		||||
| 
						 | 
				
			
			@ -4680,7 +4680,7 @@ class PubServer(BaseHTTPRequestHandler):
 | 
			
		|||
                    "@context": "https://www.w3.org/ns/activitystreams",
 | 
			
		||||
                    'actor': remove_post_actor,
 | 
			
		||||
                    'object': remove_message_id,
 | 
			
		||||
                    'to': toList,
 | 
			
		||||
                    'to': to_list,
 | 
			
		||||
                    'cc': [remove_post_actor + '/followers'],
 | 
			
		||||
                    'type': 'Delete'
 | 
			
		||||
                }
 | 
			
		||||
| 
						 | 
				
			
			@ -5461,7 +5461,7 @@ class PubServer(BaseHTTPRequestHandler):
 | 
			
		|||
                        acct_dir(base_dir, nickname, domain) + \
 | 
			
		||||
                        '/' + m_type + '.temp'
 | 
			
		||||
 | 
			
		||||
                filename, attachment_media_type = \
 | 
			
		||||
                filename, _ = \
 | 
			
		||||
                    save_media_in_form_post(media_bytes, debug,
 | 
			
		||||
                                            filename_base)
 | 
			
		||||
                if filename:
 | 
			
		||||
| 
						 | 
				
			
			@ -14956,16 +14956,16 @@ class PubServer(BaseHTTPRequestHandler):
 | 
			
		|||
                            calling_domain: str, referer_domain: str,
 | 
			
		||||
                            http_prefix: str,
 | 
			
		||||
                            domain: str, port: int,
 | 
			
		||||
                            followingItemsPerPage: int,
 | 
			
		||||
                            debug: bool, listName='following') -> None:
 | 
			
		||||
                            following_items_per_page: int,
 | 
			
		||||
                            debug: bool, list_name: str = 'following') -> None:
 | 
			
		||||
        """Returns json collection for following.txt
 | 
			
		||||
        """
 | 
			
		||||
        following_json = \
 | 
			
		||||
            get_following_feed(base_dir, domain, port, path, http_prefix,
 | 
			
		||||
                               True, followingItemsPerPage, listName)
 | 
			
		||||
                               True, following_items_per_page, list_name)
 | 
			
		||||
        if not following_json:
 | 
			
		||||
            if debug:
 | 
			
		||||
                print(listName + ' json feed not found for ' + path)
 | 
			
		||||
                print(list_name + ' json feed not found for ' + path)
 | 
			
		||||
            self._404()
 | 
			
		||||
            return
 | 
			
		||||
        msg_str = json.dumps(following_json,
 | 
			
		||||
| 
						 | 
				
			
			@ -15280,7 +15280,6 @@ class PubServer(BaseHTTPRequestHandler):
 | 
			
		|||
            known_bots_str = ''
 | 
			
		||||
            for bot_name in self.server.known_bots:
 | 
			
		||||
                known_bots_str += bot_name + '\n'
 | 
			
		||||
            # TODO
 | 
			
		||||
            msg = known_bots_str.encode('utf-8')
 | 
			
		||||
            msglen = len(msg)
 | 
			
		||||
            self._set_headers('text/plain; charset=utf-8',
 | 
			
		||||
| 
						 | 
				
			
			@ -16395,8 +16394,7 @@ class PubServer(BaseHTTPRequestHandler):
 | 
			
		|||
                                    '_GET', 'show welcome screen',
 | 
			
		||||
                                    self.server.debug)
 | 
			
		||||
                return
 | 
			
		||||
            else:
 | 
			
		||||
                self.path = self.path.replace('/welcome', '')
 | 
			
		||||
            self.path = self.path.replace('/welcome', '')
 | 
			
		||||
 | 
			
		||||
        # the welcome screen which allows you to set an avatar image
 | 
			
		||||
        if html_getreq and authorized and \
 | 
			
		||||
| 
						 | 
				
			
			@ -18556,10 +18554,11 @@ class PubServer(BaseHTTPRequestHandler):
 | 
			
		|||
            return
 | 
			
		||||
        if response_str == 'Not modified':
 | 
			
		||||
            if endpoint_type == 'put':
 | 
			
		||||
                return self._200()
 | 
			
		||||
            else:
 | 
			
		||||
                return self._304()
 | 
			
		||||
        elif response_str.startswith('ETag:') and endpoint_type == 'put':
 | 
			
		||||
                self._200()
 | 
			
		||||
                return
 | 
			
		||||
            self._304()
 | 
			
		||||
            return
 | 
			
		||||
        if response_str.startswith('ETag:') and endpoint_type == 'put':
 | 
			
		||||
            response_etag = response_str.split('ETag:', 1)[1]
 | 
			
		||||
            self._201(response_etag)
 | 
			
		||||
        elif response_str != 'Ok':
 | 
			
		||||
| 
						 | 
				
			
			@ -19483,7 +19482,7 @@ class PubServer(BaseHTTPRequestHandler):
 | 
			
		|||
                                            curr_session, proxy_type):
 | 
			
		||||
                        return 1
 | 
			
		||||
                return -1
 | 
			
		||||
            elif post_type == 'newshare' or post_type == 'newwanted':
 | 
			
		||||
            elif post_type in ('newshare', 'newwanted'):
 | 
			
		||||
                if not fields.get('itemQty'):
 | 
			
		||||
                    print(post_type + ' no itemQty')
 | 
			
		||||
                    return -1
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										19
									
								
								utils.py
								
								
								
								
							
							
						
						
									
										19
									
								
								utils.py
								
								
								
								
							| 
						 | 
				
			
			@ -2050,7 +2050,7 @@ def _is_valid_language(text: str) -> bool:
 | 
			
		|||
        "Phonetic Extensions": [7467, 7544],
 | 
			
		||||
        "Combining Half Marks": [65070, 65071]
 | 
			
		||||
    }
 | 
			
		||||
    for lang_name, lang_range in natural_languages.items():
 | 
			
		||||
    for _, lang_range in natural_languages.items():
 | 
			
		||||
        ok_lang = True
 | 
			
		||||
        for char in text:
 | 
			
		||||
            if char.isdigit() or char == '_':
 | 
			
		||||
| 
						 | 
				
			
			@ -2134,7 +2134,7 @@ def no_of_accounts(base_dir: str) -> bool:
 | 
			
		|||
    """Returns the number of accounts on the system
 | 
			
		||||
    """
 | 
			
		||||
    account_ctr = 0
 | 
			
		||||
    for subdir, dirs, files in os.walk(base_dir + '/accounts'):
 | 
			
		||||
    for _, dirs, _ in os.walk(base_dir + '/accounts'):
 | 
			
		||||
        for account in dirs:
 | 
			
		||||
            if is_account_dir(account):
 | 
			
		||||
                account_ctr += 1
 | 
			
		||||
| 
						 | 
				
			
			@ -2148,7 +2148,7 @@ def no_of_active_accounts_monthly(base_dir: str, months: int) -> bool:
 | 
			
		|||
    account_ctr = 0
 | 
			
		||||
    curr_time = int(time.time())
 | 
			
		||||
    month_seconds = int(60*60*24*30*months)
 | 
			
		||||
    for subdir, dirs, files in os.walk(base_dir + '/accounts'):
 | 
			
		||||
    for _, dirs, _ in os.walk(base_dir + '/accounts'):
 | 
			
		||||
        for account in dirs:
 | 
			
		||||
            if not is_account_dir(account):
 | 
			
		||||
                continue
 | 
			
		||||
| 
						 | 
				
			
			@ -2427,7 +2427,7 @@ def search_box_posts(base_dir: str, nickname: str, domain: str,
 | 
			
		|||
        search_words = [search_str]
 | 
			
		||||
 | 
			
		||||
    res = []
 | 
			
		||||
    for root, dirs, fnames in os.walk(path):
 | 
			
		||||
    for root, _, fnames in os.walk(path):
 | 
			
		||||
        for fname in fnames:
 | 
			
		||||
            file_path = os.path.join(root, fname)
 | 
			
		||||
            with open(file_path, 'r') as post_file:
 | 
			
		||||
| 
						 | 
				
			
			@ -3485,7 +3485,7 @@ def has_object_string_object(post_json_object: {}, debug: bool) -> bool:
 | 
			
		|||
    if post_json_object['object'].get('object'):
 | 
			
		||||
        if isinstance(post_json_object['object']['object'], str):
 | 
			
		||||
            return True
 | 
			
		||||
        elif debug:
 | 
			
		||||
        if debug:
 | 
			
		||||
            if post_json_object.get('type'):
 | 
			
		||||
                print('DEBUG: ' + post_json_object['type'] +
 | 
			
		||||
                      ' object within dict is not a string')
 | 
			
		||||
| 
						 | 
				
			
			@ -3566,14 +3566,14 @@ def load_account_timezones(base_dir: str) -> {}:
 | 
			
		|||
    """Returns a dictionary containing the preferred timezone for each account
 | 
			
		||||
    """
 | 
			
		||||
    account_timezone = {}
 | 
			
		||||
    for subdir, dirs, files in os.walk(base_dir + '/accounts'):
 | 
			
		||||
    for _, dirs, _ in os.walk(base_dir + '/accounts'):
 | 
			
		||||
        for acct in dirs:
 | 
			
		||||
            if '@' not in acct:
 | 
			
		||||
                continue
 | 
			
		||||
            if acct.startswith('inbox@') or acct.startswith('Actor@'):
 | 
			
		||||
                continue
 | 
			
		||||
            acct_dir = os.path.join(base_dir + '/accounts', acct)
 | 
			
		||||
            tz_filename = acct_dir + '/timezone.txt'
 | 
			
		||||
            acct_directory = os.path.join(base_dir + '/accounts', acct)
 | 
			
		||||
            tz_filename = acct_directory + '/timezone.txt'
 | 
			
		||||
            if not os.path.isfile(tz_filename):
 | 
			
		||||
                continue
 | 
			
		||||
            timezone = None
 | 
			
		||||
| 
						 | 
				
			
			@ -3590,7 +3590,7 @@ def load_bold_reading(base_dir: str) -> {}:
 | 
			
		|||
    """Returns a dictionary containing the bold reading status for each account
 | 
			
		||||
    """
 | 
			
		||||
    bold_reading = {}
 | 
			
		||||
    for subdir, dirs, files in os.walk(base_dir + '/accounts'):
 | 
			
		||||
    for _, dirs, _ in os.walk(base_dir + '/accounts'):
 | 
			
		||||
        for acct in dirs:
 | 
			
		||||
            if '@' not in acct:
 | 
			
		||||
                continue
 | 
			
		||||
| 
						 | 
				
			
			@ -3601,6 +3601,7 @@ def load_bold_reading(base_dir: str) -> {}:
 | 
			
		|||
            if os.path.isfile(bold_reading_filename):
 | 
			
		||||
                nickname = acct.split('@')[0]
 | 
			
		||||
                bold_reading[nickname] = True
 | 
			
		||||
        break
 | 
			
		||||
    return bold_reading
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1174,7 +1174,7 @@ def _html_profile_following(translate: {}, base_dir: str, http_prefix: str,
 | 
			
		|||
                            session, cached_webfingers: {}, person_cache: {},
 | 
			
		||||
                            following_json: {}, project_version: str,
 | 
			
		||||
                            buttons: [],
 | 
			
		||||
                            feedName: str, actor: str,
 | 
			
		||||
                            feed_name: str, actor: str,
 | 
			
		||||
                            page_number: int,
 | 
			
		||||
                            max_items_per_page: int,
 | 
			
		||||
                            dormant_months: int, debug: bool,
 | 
			
		||||
| 
						 | 
				
			
			@ -1188,7 +1188,7 @@ def _html_profile_following(translate: {}, base_dir: str, http_prefix: str,
 | 
			
		|||
            # page up arrow
 | 
			
		||||
            profile_str += \
 | 
			
		||||
                '  <center>\n' + \
 | 
			
		||||
                '    <a href="' + actor + '/' + feedName + \
 | 
			
		||||
                '    <a href="' + actor + '/' + feed_name + \
 | 
			
		||||
                '?page=' + str(page_number - 1) + '#buttonheader' + \
 | 
			
		||||
                '"><img loading="lazy" decoding="async" ' + \
 | 
			
		||||
                'class="pageicon" src="/' + \
 | 
			
		||||
| 
						 | 
				
			
			@ -1200,7 +1200,7 @@ def _html_profile_following(translate: {}, base_dir: str, http_prefix: str,
 | 
			
		|||
    for following_actor in following_json['orderedItems']:
 | 
			
		||||
        # is this a dormant followed account?
 | 
			
		||||
        dormant = False
 | 
			
		||||
        if authorized and feedName == 'following':
 | 
			
		||||
        if authorized and feed_name == 'following':
 | 
			
		||||
            dormant = \
 | 
			
		||||
                is_dormant(base_dir, nickname, domain, following_actor,
 | 
			
		||||
                           dormant_months)
 | 
			
		||||
| 
						 | 
				
			
			@ -1219,7 +1219,7 @@ def _html_profile_following(translate: {}, base_dir: str, http_prefix: str,
 | 
			
		|||
            # page down arrow
 | 
			
		||||
            profile_str += \
 | 
			
		||||
                '  <center>\n' + \
 | 
			
		||||
                '    <a href="' + actor + '/' + feedName + \
 | 
			
		||||
                '    <a href="' + actor + '/' + feed_name + \
 | 
			
		||||
                '?page=' + str(page_number + 1) + '#buttonheader' + \
 | 
			
		||||
                '"><img loading="lazy" decoding="async" ' + \
 | 
			
		||||
                'class="pageicon" src="/' + \
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -433,8 +433,7 @@ def _page_number_buttons(users_path: str, box_name: str,
 | 
			
		|||
    """
 | 
			
		||||
    pages_width = 3
 | 
			
		||||
    min_page_number = page_number - pages_width
 | 
			
		||||
    if min_page_number < 1:
 | 
			
		||||
        min_page_number = 1
 | 
			
		||||
    min_page_number = max(min_page_number, 1)
 | 
			
		||||
    max_page_number = min_page_number + 1 + (pages_width * 2)
 | 
			
		||||
    num_str = ''
 | 
			
		||||
    for page in range(min_page_number, max_page_number):
 | 
			
		||||
| 
						 | 
				
			
			@ -1058,7 +1057,7 @@ def html_timeline(css_cache: {}, default_timeline: str,
 | 
			
		|||
def html_individual_share(domain: str, share_id: str,
 | 
			
		||||
                          actor: str, shared_item: {}, translate: {},
 | 
			
		||||
                          show_contact: bool, remove_button: bool,
 | 
			
		||||
                          sharesFileType: str) -> str:
 | 
			
		||||
                          shares_file_type: str) -> str:
 | 
			
		||||
    """Returns an individual shared item as html
 | 
			
		||||
    """
 | 
			
		||||
    profile_str = '<div class="container">\n'
 | 
			
		||||
| 
						 | 
				
			
			@ -1115,7 +1114,7 @@ def html_individual_share(domain: str, share_id: str,
 | 
			
		|||
                '<a href="' + contact_actor + '"><button class="button">' + \
 | 
			
		||||
                translate['Profile'] + '</button></a>\n'
 | 
			
		||||
        if remove_button and domain in share_id:
 | 
			
		||||
            if sharesFileType == 'shares':
 | 
			
		||||
            if shares_file_type == 'shares':
 | 
			
		||||
                profile_str += \
 | 
			
		||||
                    ' <a href="' + actor + '?rmshare=' + share_id + \
 | 
			
		||||
                    '"><button class="button">' + \
 | 
			
		||||
| 
						 | 
				
			
			@ -1134,14 +1133,14 @@ def _html_shares_timeline(translate: {}, page_number: int, items_per_page: int,
 | 
			
		|||
                          nickname: str, domain: str, port: int,
 | 
			
		||||
                          max_shares_per_account: int, http_prefix: str,
 | 
			
		||||
                          shared_items_federated_domains: [],
 | 
			
		||||
                          sharesFileType: str) -> str:
 | 
			
		||||
                          shares_file_type: str) -> str:
 | 
			
		||||
    """Show shared items timeline as html
 | 
			
		||||
    """
 | 
			
		||||
    shares_json, lastPage = \
 | 
			
		||||
    shares_json, last_page = \
 | 
			
		||||
        shares_timeline_json(actor, page_number, items_per_page,
 | 
			
		||||
                             base_dir, domain, nickname,
 | 
			
		||||
                             max_shares_per_account,
 | 
			
		||||
                             shared_items_federated_domains, sharesFileType)
 | 
			
		||||
                             shared_items_federated_domains, shares_file_type)
 | 
			
		||||
    domain_full = get_full_domain(domain, port)
 | 
			
		||||
    actor = local_actor_url(http_prefix, nickname, domain_full)
 | 
			
		||||
    admin_nickname = get_config_param(base_dir, 'admin')
 | 
			
		||||
| 
						 | 
				
			
			@ -1153,10 +1152,10 @@ def _html_shares_timeline(translate: {}, page_number: int, items_per_page: int,
 | 
			
		|||
 | 
			
		||||
    if page_number > 1:
 | 
			
		||||
        timeline_str += '<br>' + \
 | 
			
		||||
            _page_number_buttons(actor, 'tl' + sharesFileType, page_number)
 | 
			
		||||
            _page_number_buttons(actor, 'tl' + shares_file_type, page_number)
 | 
			
		||||
        timeline_str += \
 | 
			
		||||
            '  <center>\n' + \
 | 
			
		||||
            '    <a href="' + actor + '/tl' + sharesFileType + '?page=' + \
 | 
			
		||||
            '    <a href="' + actor + '/tl' + shares_file_type + '?page=' + \
 | 
			
		||||
            str(page_number - 1) + \
 | 
			
		||||
            '#timelineposts" class="imageAnchor" tabindex="9">' + \
 | 
			
		||||
            '<img loading="lazy" decoding="async" ' + \
 | 
			
		||||
| 
						 | 
				
			
			@ -1188,17 +1187,18 @@ def _html_shares_timeline(translate: {}, page_number: int, items_per_page: int,
 | 
			
		|||
            html_individual_share(domain, shared_item['shareId'],
 | 
			
		||||
                                  actor, shared_item, translate,
 | 
			
		||||
                                  show_contact_button, show_remove_button,
 | 
			
		||||
                                  sharesFileType)
 | 
			
		||||
                                  shares_file_type)
 | 
			
		||||
        timeline_str += separator_str
 | 
			
		||||
        ctr += 1
 | 
			
		||||
 | 
			
		||||
    if ctr == 0:
 | 
			
		||||
        timeline_str += _get_help_for_timeline(base_dir, 'tl' + sharesFileType)
 | 
			
		||||
        timeline_str += \
 | 
			
		||||
            _get_help_for_timeline(base_dir, 'tl' + shares_file_type)
 | 
			
		||||
 | 
			
		||||
    if not lastPage:
 | 
			
		||||
    if not last_page:
 | 
			
		||||
        timeline_str += \
 | 
			
		||||
            '  <center>\n' + \
 | 
			
		||||
            '    <a href="' + actor + '/tl' + sharesFileType + '?page=' + \
 | 
			
		||||
            '    <a href="' + actor + '/tl' + shares_file_type + '?page=' + \
 | 
			
		||||
            str(page_number + 1) + \
 | 
			
		||||
            '#timelineposts" class="imageAnchor" tabindex="9">' + \
 | 
			
		||||
            '<img loading="lazy" decoding="async" ' + \
 | 
			
		||||
| 
						 | 
				
			
			@ -1207,7 +1207,7 @@ def _html_shares_timeline(translate: {}, page_number: int, items_per_page: int,
 | 
			
		|||
            '" alt="' + translate['Page down'] + '"></a>\n' + \
 | 
			
		||||
            '  </center>\n'
 | 
			
		||||
        timeline_str += \
 | 
			
		||||
            _page_number_buttons(actor, 'tl' + sharesFileType, page_number)
 | 
			
		||||
            _page_number_buttons(actor, 'tl' + shares_file_type, page_number)
 | 
			
		||||
        timeline_str += '<br>'
 | 
			
		||||
 | 
			
		||||
    return timeline_str
 | 
			
		||||
| 
						 | 
				
			
			@ -1338,7 +1338,7 @@ def html_inbox(css_cache: {}, default_timeline: str,
 | 
			
		|||
               translate: {}, page_number: int, items_per_page: int,
 | 
			
		||||
               session, base_dir: str,
 | 
			
		||||
               cached_webfingers: {}, person_cache: {},
 | 
			
		||||
               nickname: str, domain: str, port: int, inboxJson: {},
 | 
			
		||||
               nickname: str, domain: str, port: int, inbox_json: {},
 | 
			
		||||
               allow_deletion: bool,
 | 
			
		||||
               http_prefix: str, project_version: str,
 | 
			
		||||
               minimal: bool,
 | 
			
		||||
| 
						 | 
				
			
			@ -1372,7 +1372,7 @@ def html_inbox(css_cache: {}, default_timeline: str,
 | 
			
		|||
                         translate, page_number,
 | 
			
		||||
                         items_per_page, session, base_dir,
 | 
			
		||||
                         cached_webfingers, person_cache,
 | 
			
		||||
                         nickname, domain, port, inboxJson,
 | 
			
		||||
                         nickname, domain, port, inbox_json,
 | 
			
		||||
                         'inbox', allow_deletion,
 | 
			
		||||
                         http_prefix, project_version,
 | 
			
		||||
                         manually_approve_followers,
 | 
			
		||||
| 
						 | 
				
			
			@ -1399,7 +1399,7 @@ def html_bookmarks(css_cache: {}, default_timeline: str,
 | 
			
		|||
                   translate: {}, page_number: int, items_per_page: int,
 | 
			
		||||
                   session, base_dir: str,
 | 
			
		||||
                   cached_webfingers: {}, person_cache: {},
 | 
			
		||||
                   nickname: str, domain: str, port: int, bookmarksJson: {},
 | 
			
		||||
                   nickname: str, domain: str, port: int, bookmarks_json: {},
 | 
			
		||||
                   allow_deletion: bool,
 | 
			
		||||
                   http_prefix: str, project_version: str,
 | 
			
		||||
                   minimal: bool,
 | 
			
		||||
| 
						 | 
				
			
			@ -1433,7 +1433,7 @@ def html_bookmarks(css_cache: {}, default_timeline: str,
 | 
			
		|||
                         translate, page_number,
 | 
			
		||||
                         items_per_page, session, base_dir,
 | 
			
		||||
                         cached_webfingers, person_cache,
 | 
			
		||||
                         nickname, domain, port, bookmarksJson,
 | 
			
		||||
                         nickname, domain, port, bookmarks_json,
 | 
			
		||||
                         'tlbookmarks', allow_deletion,
 | 
			
		||||
                         http_prefix, project_version,
 | 
			
		||||
                         manually_approve_followers,
 | 
			
		||||
| 
						 | 
				
			
			@ -1459,7 +1459,7 @@ def html_inbox_dms(css_cache: {}, default_timeline: str,
 | 
			
		|||
                   translate: {}, page_number: int, items_per_page: int,
 | 
			
		||||
                   session, base_dir: str,
 | 
			
		||||
                   cached_webfingers: {}, person_cache: {},
 | 
			
		||||
                   nickname: str, domain: str, port: int, inboxJson: {},
 | 
			
		||||
                   nickname: str, domain: str, port: int, inbox_json: {},
 | 
			
		||||
                   allow_deletion: bool,
 | 
			
		||||
                   http_prefix: str, project_version: str,
 | 
			
		||||
                   minimal: bool,
 | 
			
		||||
| 
						 | 
				
			
			@ -1490,7 +1490,7 @@ def html_inbox_dms(css_cache: {}, default_timeline: str,
 | 
			
		|||
                         translate, page_number,
 | 
			
		||||
                         items_per_page, session, base_dir,
 | 
			
		||||
                         cached_webfingers, person_cache,
 | 
			
		||||
                         nickname, domain, port, inboxJson,
 | 
			
		||||
                         nickname, domain, port, inbox_json,
 | 
			
		||||
                         'dm', allow_deletion,
 | 
			
		||||
                         http_prefix, project_version, False, minimal,
 | 
			
		||||
                         yt_replace_domain,
 | 
			
		||||
| 
						 | 
				
			
			@ -1515,7 +1515,7 @@ def html_inbox_replies(css_cache: {}, default_timeline: str,
 | 
			
		|||
                       translate: {}, page_number: int, items_per_page: int,
 | 
			
		||||
                       session, base_dir: str,
 | 
			
		||||
                       cached_webfingers: {}, person_cache: {},
 | 
			
		||||
                       nickname: str, domain: str, port: int, inboxJson: {},
 | 
			
		||||
                       nickname: str, domain: str, port: int, inbox_json: {},
 | 
			
		||||
                       allow_deletion: bool,
 | 
			
		||||
                       http_prefix: str, project_version: str,
 | 
			
		||||
                       minimal: bool,
 | 
			
		||||
| 
						 | 
				
			
			@ -1546,7 +1546,7 @@ def html_inbox_replies(css_cache: {}, default_timeline: str,
 | 
			
		|||
                         translate, page_number,
 | 
			
		||||
                         items_per_page, session, base_dir,
 | 
			
		||||
                         cached_webfingers, person_cache,
 | 
			
		||||
                         nickname, domain, port, inboxJson, 'tlreplies',
 | 
			
		||||
                         nickname, domain, port, inbox_json, 'tlreplies',
 | 
			
		||||
                         allow_deletion, http_prefix, project_version, False,
 | 
			
		||||
                         minimal,
 | 
			
		||||
                         yt_replace_domain,
 | 
			
		||||
| 
						 | 
				
			
			@ -1569,7 +1569,7 @@ def html_inbox_media(css_cache: {}, default_timeline: str,
 | 
			
		|||
                     translate: {}, page_number: int, items_per_page: int,
 | 
			
		||||
                     session, base_dir: str,
 | 
			
		||||
                     cached_webfingers: {}, person_cache: {},
 | 
			
		||||
                     nickname: str, domain: str, port: int, inboxJson: {},
 | 
			
		||||
                     nickname: str, domain: str, port: int, inbox_json: {},
 | 
			
		||||
                     allow_deletion: bool,
 | 
			
		||||
                     http_prefix: str, project_version: str,
 | 
			
		||||
                     minimal: bool,
 | 
			
		||||
| 
						 | 
				
			
			@ -1600,7 +1600,7 @@ def html_inbox_media(css_cache: {}, default_timeline: str,
 | 
			
		|||
                         translate, page_number,
 | 
			
		||||
                         items_per_page, session, base_dir,
 | 
			
		||||
                         cached_webfingers, person_cache,
 | 
			
		||||
                         nickname, domain, port, inboxJson, 'tlmedia',
 | 
			
		||||
                         nickname, domain, port, inbox_json, 'tlmedia',
 | 
			
		||||
                         allow_deletion, http_prefix, project_version, False,
 | 
			
		||||
                         minimal,
 | 
			
		||||
                         yt_replace_domain,
 | 
			
		||||
| 
						 | 
				
			
			@ -1623,7 +1623,7 @@ def html_inbox_blogs(css_cache: {}, default_timeline: str,
 | 
			
		|||
                     translate: {}, page_number: int, items_per_page: int,
 | 
			
		||||
                     session, base_dir: str,
 | 
			
		||||
                     cached_webfingers: {}, person_cache: {},
 | 
			
		||||
                     nickname: str, domain: str, port: int, inboxJson: {},
 | 
			
		||||
                     nickname: str, domain: str, port: int, inbox_json: {},
 | 
			
		||||
                     allow_deletion: bool,
 | 
			
		||||
                     http_prefix: str, project_version: str,
 | 
			
		||||
                     minimal: bool,
 | 
			
		||||
| 
						 | 
				
			
			@ -1654,7 +1654,7 @@ def html_inbox_blogs(css_cache: {}, default_timeline: str,
 | 
			
		|||
                         translate, page_number,
 | 
			
		||||
                         items_per_page, session, base_dir,
 | 
			
		||||
                         cached_webfingers, person_cache,
 | 
			
		||||
                         nickname, domain, port, inboxJson, 'tlblogs',
 | 
			
		||||
                         nickname, domain, port, inbox_json, 'tlblogs',
 | 
			
		||||
                         allow_deletion, http_prefix, project_version, False,
 | 
			
		||||
                         minimal,
 | 
			
		||||
                         yt_replace_domain,
 | 
			
		||||
| 
						 | 
				
			
			@ -1677,7 +1677,7 @@ def html_inbox_features(css_cache: {}, default_timeline: str,
 | 
			
		|||
                        translate: {}, page_number: int, items_per_page: int,
 | 
			
		||||
                        session, base_dir: str,
 | 
			
		||||
                        cached_webfingers: {}, person_cache: {},
 | 
			
		||||
                        nickname: str, domain: str, port: int, inboxJson: {},
 | 
			
		||||
                        nickname: str, domain: str, port: int, inbox_json: {},
 | 
			
		||||
                        allow_deletion: bool,
 | 
			
		||||
                        http_prefix: str, project_version: str,
 | 
			
		||||
                        minimal: bool,
 | 
			
		||||
| 
						 | 
				
			
			@ -1708,7 +1708,7 @@ def html_inbox_features(css_cache: {}, default_timeline: str,
 | 
			
		|||
                         translate, page_number,
 | 
			
		||||
                         items_per_page, session, base_dir,
 | 
			
		||||
                         cached_webfingers, person_cache,
 | 
			
		||||
                         nickname, domain, port, inboxJson, 'tlfeatures',
 | 
			
		||||
                         nickname, domain, port, inbox_json, 'tlfeatures',
 | 
			
		||||
                         allow_deletion, http_prefix, project_version, False,
 | 
			
		||||
                         minimal,
 | 
			
		||||
                         yt_replace_domain,
 | 
			
		||||
| 
						 | 
				
			
			@ -1731,7 +1731,7 @@ def html_inbox_news(css_cache: {}, default_timeline: str,
 | 
			
		|||
                    translate: {}, page_number: int, items_per_page: int,
 | 
			
		||||
                    session, base_dir: str,
 | 
			
		||||
                    cached_webfingers: {}, person_cache: {},
 | 
			
		||||
                    nickname: str, domain: str, port: int, inboxJson: {},
 | 
			
		||||
                    nickname: str, domain: str, port: int, inbox_json: {},
 | 
			
		||||
                    allow_deletion: bool,
 | 
			
		||||
                    http_prefix: str, project_version: str,
 | 
			
		||||
                    minimal: bool,
 | 
			
		||||
| 
						 | 
				
			
			@ -1761,7 +1761,7 @@ def html_inbox_news(css_cache: {}, default_timeline: str,
 | 
			
		|||
                         translate, page_number,
 | 
			
		||||
                         items_per_page, session, base_dir,
 | 
			
		||||
                         cached_webfingers, person_cache,
 | 
			
		||||
                         nickname, domain, port, inboxJson, 'tlnews',
 | 
			
		||||
                         nickname, domain, port, inbox_json, 'tlnews',
 | 
			
		||||
                         allow_deletion, http_prefix, project_version, False,
 | 
			
		||||
                         minimal,
 | 
			
		||||
                         yt_replace_domain,
 | 
			
		||||
| 
						 | 
				
			
			@ -1784,7 +1784,7 @@ def html_outbox(css_cache: {}, default_timeline: str,
 | 
			
		|||
                translate: {}, page_number: int, items_per_page: int,
 | 
			
		||||
                session, base_dir: str,
 | 
			
		||||
                cached_webfingers: {}, person_cache: {},
 | 
			
		||||
                nickname: str, domain: str, port: int, outboxJson: {},
 | 
			
		||||
                nickname: str, domain: str, port: int, outbox_json: {},
 | 
			
		||||
                allow_deletion: bool,
 | 
			
		||||
                http_prefix: str, project_version: str,
 | 
			
		||||
                minimal: bool,
 | 
			
		||||
| 
						 | 
				
			
			@ -1817,7 +1817,7 @@ def html_outbox(css_cache: {}, default_timeline: str,
 | 
			
		|||
                         translate, page_number,
 | 
			
		||||
                         items_per_page, session, base_dir,
 | 
			
		||||
                         cached_webfingers, person_cache,
 | 
			
		||||
                         nickname, domain, port, outboxJson, 'outbox',
 | 
			
		||||
                         nickname, domain, port, outbox_json, 'outbox',
 | 
			
		||||
                         allow_deletion, http_prefix, project_version,
 | 
			
		||||
                         manually_approve_followers, minimal,
 | 
			
		||||
                         yt_replace_domain,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -457,8 +457,7 @@ def shares_timeline_json(actor: str, pageNumber: int, items_per_page: int,
 | 
			
		|||
    if start_index >= max_index - items_per_page:
 | 
			
		||||
        last_page = True
 | 
			
		||||
        start_index = max_index - items_per_page
 | 
			
		||||
        if start_index < 0:
 | 
			
		||||
            start_index = 0
 | 
			
		||||
        start_index = max(start_index, 0)
 | 
			
		||||
    ctr = 0
 | 
			
		||||
    result_json = {}
 | 
			
		||||
    for published, item in shares_json.items():
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue