'
delete_post_str += \
' ' + \
diff --git a/webapp_create_post.py b/webapp_create_post.py
index c764f442b..620ff8efa 100644
--- a/webapp_create_post.py
+++ b/webapp_create_post.py
@@ -225,7 +225,8 @@ def html_new_post(media_instance: bool, translate: {},
cw_lists: {}, lists_enabled: str,
box_name: str,
reply_is_chat: bool, bold_reading: bool,
- dogwhistles: {}) -> str:
+ dogwhistles: {},
+ min_images_for_accounts: []) -> str:
"""New post screen
"""
reply_str = ''
@@ -279,6 +280,9 @@ def html_new_post(media_instance: bool, translate: {},
if post_json_object:
timezone = \
get_account_timezone(base_dir, nickname, domain)
+ minimize_all_images = False
+ if nickname in min_images_for_accounts:
+ minimize_all_images = True
new_post_text += \
individual_post_as_html(signing_priv_key_pem,
True, recent_posts_cache,
@@ -304,7 +308,8 @@ def html_new_post(media_instance: bool, translate: {},
False, False, False,
cw_lists, lists_enabled,
timezone, False,
- bold_reading, dogwhistles)
+ bold_reading, dogwhistles,
+ minimize_all_images)
reply_str = '\n'
diff --git a/webapp_frontscreen.py b/webapp_frontscreen.py
index f70ae203a..c6eb567f3 100644
--- a/webapp_frontscreen.py
+++ b/webapp_frontscreen.py
@@ -39,7 +39,8 @@ def _html_front_screen_posts(recent_posts_cache: {}, max_recent_posts: int,
signing_priv_key_pem: str, cw_lists: {},
lists_enabled: str,
bold_reading: bool,
- dogwhistles: {}) -> str:
+ dogwhistles: {},
+ min_images_for_accounts: []) -> str:
"""Shows posts on the front screen of a news instance
These should only be public blog posts from the features timeline
which is the blog timeline of the news actor
@@ -67,6 +68,9 @@ def _html_front_screen_posts(recent_posts_cache: {}, max_recent_posts: int,
for item in outbox_feed['orderedItems']:
if item['type'] == 'Create':
timezone = get_account_timezone(base_dir, nickname, domain)
+ minimize_all_images = False
+ if nickname in min_images_for_accounts:
+ minimize_all_images = True
post_str = \
individual_post_as_html(signing_priv_key_pem,
True, recent_posts_cache,
@@ -90,7 +94,8 @@ def _html_front_screen_posts(recent_posts_cache: {}, max_recent_posts: int,
True, False, False,
cw_lists, lists_enabled,
timezone, False,
- bold_reading, dogwhistles)
+ bold_reading, dogwhistles,
+ minimize_all_images)
if post_str:
profile_str += post_str + separator_str
ctr += 1
@@ -122,7 +127,8 @@ def html_front_screen(signing_priv_key_pem: str,
page_number: int,
max_items_per_page: int,
cw_lists: {}, lists_enabled: str,
- dogwhistles: {}) -> str:
+ dogwhistles: {},
+ min_images_for_accounts: []) -> str:
"""Show the news instance front screen
"""
bold_reading = False
@@ -197,7 +203,8 @@ def html_front_screen(signing_priv_key_pem: str,
max_like_count,
signing_priv_key_pem,
cw_lists, lists_enabled,
- bold_reading, dogwhistles) + license_str
+ bold_reading, dogwhistles,
+ min_images_for_accounts) + license_str
# Footer which is only used for system accounts
profile_footer_str = ' \n'
diff --git a/webapp_likers.py b/webapp_likers.py
index 9650e19bd..2829e3e87 100644
--- a/webapp_likers.py
+++ b/webapp_likers.py
@@ -42,6 +42,7 @@ def html_likers_of_post(base_dir: str, nickname: str,
cw_lists: {}, lists_enabled: str,
box_name: str, default_timeline: str,
bold_reading: bool, dogwhistles: {},
+ min_images_for_accounts: [],
dict_name: str = 'likes') -> str:
"""Returns html for a screen showing who liked a post
"""
@@ -83,6 +84,9 @@ def html_likers_of_post(base_dir: str, nickname: str,
mitm = False
if os.path.isfile(filename.replace('.json', '') + '.mitm'):
mitm = True
+ minimize_all_images = False
+ if nickname in min_images_for_accounts:
+ minimize_all_images = True
html_str += \
individual_post_as_html(signing_priv_key_pem,
True, recent_posts_cache,
@@ -108,7 +112,8 @@ def html_likers_of_post(base_dir: str, nickname: str,
False, False, False,
cw_lists, lists_enabled,
timezone, mitm, bold_reading,
- dogwhistles)
+ dogwhistles,
+ minimize_all_images)
# show likers beneath the post
obj = post_json_object
diff --git a/webapp_moderation.py b/webapp_moderation.py
index ed41862ad..360aebbc7 100644
--- a/webapp_moderation.py
+++ b/webapp_moderation.py
@@ -58,7 +58,8 @@ def html_moderation(default_timeline: str,
signing_priv_key_pem: str,
cw_lists: {}, lists_enabled: str,
timezone: str, bold_reading: bool,
- dogwhistles: {}, ua_str: str) -> str:
+ dogwhistles: {}, ua_str: str,
+ min_images_for_accounts: []) -> str:
"""Show the moderation feed as html
This is what you see when selecting the "mod" timeline
"""
@@ -84,7 +85,8 @@ def html_moderation(default_timeline: str,
text_mode_banner, access_keys, system_language,
max_like_count, shared_items_federated_domains,
signing_priv_key_pem, cw_lists, lists_enabled,
- timezone, bold_reading, dogwhistles, ua_str)
+ timezone, bold_reading, dogwhistles, ua_str,
+ min_images_for_accounts)
def html_account_info(translate: {},
diff --git a/webapp_post.py b/webapp_post.py
index ce8f36f3c..f94d47589 100644
--- a/webapp_post.py
+++ b/webapp_post.py
@@ -1597,7 +1597,8 @@ def individual_post_as_html(signing_priv_key_pem: str,
lists_enabled: str,
timezone: str,
mitm: bool, bold_reading: bool,
- dogwhistles: {}) -> str:
+ dogwhistles: {},
+ minimize_all_images: bool) -> str:
""" Shows a single post as html
"""
if not post_json_object:
@@ -2072,7 +2073,8 @@ def individual_post_as_html(signing_priv_key_pem: str,
is_muted, avatar_link,
reply_str, announce_str, like_str,
bookmark_str, delete_str, mute_str,
- content_str)
+ content_str,
+ minimize_all_images)
published_str = \
_get_published_date_str(post_json_object, show_published_date_only,
@@ -2399,7 +2401,8 @@ def html_individual_post(recent_posts_cache: {}, max_recent_posts: int,
max_like_count: int, signing_priv_key_pem: str,
cw_lists: {}, lists_enabled: str,
timezone: str, mitm: bool,
- bold_reading: bool, dogwhistles: {}) -> str:
+ bold_reading: bool, dogwhistles: {},
+ min_images_for_accounts: []) -> str:
"""Show an individual post as html
"""
original_post_json = post_json_object
@@ -2451,6 +2454,9 @@ def html_individual_post(recent_posts_cache: {}, max_recent_posts: int,
follow_str += ' \n'
post_str += follow_str + '
\n'
+ minimize_all_images = False
+ if nickname in min_images_for_accounts:
+ minimize_all_images = True
post_str += \
individual_post_as_html(signing_priv_key_pem,
True, recent_posts_cache, max_recent_posts,
@@ -2468,7 +2474,8 @@ def html_individual_post(recent_posts_cache: {}, max_recent_posts: int,
system_language, max_like_count,
False, authorized, False, False, False, False,
cw_lists, lists_enabled, timezone, mitm,
- bold_reading, dogwhistles)
+ bold_reading, dogwhistles,
+ minimize_all_images)
message_id = remove_id_ending(post_json_object['id'])
# show the previous posts
@@ -2510,7 +2517,8 @@ def html_individual_post(recent_posts_cache: {}, max_recent_posts: int,
cw_lists, lists_enabled,
timezone, mitm,
bold_reading,
- dogwhistles) + post_str
+ dogwhistles,
+ minimize_all_images) + post_str
# show the following posts
post_filename = locate_post(base_dir, nickname, domain, message_id)
@@ -2549,7 +2557,8 @@ def html_individual_post(recent_posts_cache: {}, max_recent_posts: int,
False, False, False, False,
cw_lists, lists_enabled,
timezone, False,
- bold_reading, dogwhistles)
+ bold_reading, dogwhistles,
+ minimize_all_images)
css_filename = base_dir + '/epicyon-profile.css'
if os.path.isfile(base_dir + '/epicyon.css'):
css_filename = base_dir + '/epicyon.css'
@@ -2578,11 +2587,15 @@ def html_post_replies(recent_posts_cache: {}, max_recent_posts: int,
signing_priv_key_pem: str, cw_lists: {},
lists_enabled: str,
timezone: str, bold_reading: bool,
- dogwhistles: {}) -> str:
+ dogwhistles: {},
+ min_images_for_accounts: []) -> str:
"""Show the replies to an individual post as html
"""
replies_str = ''
if replies_json.get('orderedItems'):
+ minimize_all_images = False
+ if nickname in min_images_for_accounts:
+ minimize_all_images = True
for item in replies_json['orderedItems']:
replies_str += \
individual_post_as_html(signing_priv_key_pem,
@@ -2605,7 +2618,8 @@ def html_post_replies(recent_posts_cache: {}, max_recent_posts: int,
False, False,
cw_lists, lists_enabled,
timezone, False,
- bold_reading, dogwhistles)
+ bold_reading, dogwhistles,
+ minimize_all_images)
css_filename = base_dir + '/epicyon-profile.css'
if os.path.isfile(base_dir + '/epicyon.css'):
@@ -2635,9 +2649,13 @@ def html_emoji_reaction_picker(recent_posts_cache: {}, max_recent_posts: int,
cw_lists: {}, lists_enabled: str,
box_name: str, page_number: int,
timezone: str, bold_reading: bool,
- dogwhistles: {}) -> str:
+ dogwhistles: {},
+ min_images_for_accounts: []) -> str:
"""Returns the emoji picker screen
"""
+ minimize_all_images = False
+ if nickname in min_images_for_accounts:
+ minimize_all_images = True
reacted_to_post_str = \
'
\n' + \
@@ -2659,7 +2677,8 @@ def html_emoji_reaction_picker(recent_posts_cache: {}, max_recent_posts: int,
max_like_count,
False, False, False, False, False, False,
cw_lists, lists_enabled, timezone, False,
- bold_reading, dogwhistles)
+ bold_reading, dogwhistles,
+ minimize_all_images)
reactions_filename = base_dir + '/emoji/reactions.json'
if not os.path.isfile(reactions_filename):
diff --git a/webapp_profile.py b/webapp_profile.py
index 2404e5084..5a4167147 100644
--- a/webapp_profile.py
+++ b/webapp_profile.py
@@ -156,7 +156,8 @@ def html_profile_after_search(recent_posts_cache: {}, max_recent_posts: int,
cw_lists: {}, lists_enabled: str,
timezone: str,
onion_domain: str, i2p_domain: str,
- bold_reading: bool, dogwhistles: {}) -> str:
+ bold_reading: bool, dogwhistles: {},
+ min_images_for_accounts: []) -> str:
"""Show a profile page after a search for a fediverse address
"""
http = False
@@ -369,6 +370,9 @@ def html_profile_after_search(recent_posts_cache: {}, max_recent_posts: int,
session, outbox_url, as_header, project_version,
http_prefix, from_domain, debug)
if user_feed:
+ minimize_all_images = False
+ if nickname in min_images_for_accounts:
+ minimize_all_images = True
i = 0
for item in user_feed:
show_item, post_json_object = \
@@ -398,7 +402,8 @@ def html_profile_after_search(recent_posts_cache: {}, max_recent_posts: int,
False, False, False,
cw_lists, lists_enabled,
timezone, False,
- bold_reading, dogwhistles)
+ bold_reading, dogwhistles,
+ minimize_all_images)
i += 1
if i >= 8:
break
@@ -635,6 +640,7 @@ def html_profile(signing_priv_key_pem: str,
if not nickname:
return ""
if is_system_account(nickname):
+ min_images_for_accounts = []
return html_front_screen(signing_priv_key_pem,
rss_icon_at_top,
icons_as_buttons,
@@ -652,7 +658,8 @@ def html_profile(signing_priv_key_pem: str,
system_language, max_like_count,
shared_items_federated_domains, None,
page_number, max_items_per_page, cw_lists,
- lists_enabled, {})
+ lists_enabled, {},
+ min_images_for_accounts)
domain, port = get_domain_from_actor(profile_json['id'])
if not domain:
@@ -1063,6 +1070,7 @@ def html_profile(signing_priv_key_pem: str,
translate['Get the source code'] + '" src="/icons/agpl.png" />'
if selected == 'posts':
+ min_images_for_accounts = []
profile_str += \
_html_profile_posts(recent_posts_cache, max_recent_posts,
translate,
@@ -1079,7 +1087,8 @@ def html_profile(signing_priv_key_pem: str,
max_like_count,
signing_priv_key_pem,
cw_lists, lists_enabled,
- timezone, bold_reading, {}) + license_str
+ timezone, bold_reading, {},
+ min_images_for_accounts) + license_str
if not is_group:
if selected == 'following':
profile_str += \
@@ -1153,7 +1162,8 @@ def _html_profile_posts(recent_posts_cache: {}, max_recent_posts: int,
signing_priv_key_pem: str,
cw_lists: {}, lists_enabled: str,
timezone: str, bold_reading: bool,
- dogwhistles: {}) -> str:
+ dogwhistles: {},
+ min_images_for_accounts: []) -> str:
"""Shows posts on the profile screen
These should only be public posts
"""
@@ -1163,6 +1173,9 @@ def _html_profile_posts(recent_posts_cache: {}, max_recent_posts: int,
ctr = 0
curr_page = 1
box_name = 'outbox'
+ minimize_all_images = False
+ if nickname in min_images_for_accounts:
+ minimize_all_images = True
while ctr < max_items and curr_page < 4:
outbox_feed_path_str = \
'/users/' + nickname + '/' + box_name + '?page=' + \
@@ -1203,7 +1216,8 @@ def _html_profile_posts(recent_posts_cache: {}, max_recent_posts: int,
True, False, False,
cw_lists, lists_enabled,
timezone, False,
- bold_reading, dogwhistles)
+ bold_reading, dogwhistles,
+ minimize_all_images)
if post_str:
profile_str += post_str + separator_str
ctr += 1
@@ -2140,7 +2154,9 @@ def _html_edit_profile_options(is_admin: bool,
notify_likes: str, notify_reactions: str,
hide_like_button: str,
hide_reaction_button: str,
- translate: {}, bold_reading: bool) -> str:
+ translate: {}, bold_reading: bool,
+ nickname: str,
+ min_images_for_accounts: []) -> str:
"""option checkboxes section of edit profile screen
"""
edit_profile_form = ' \n'
@@ -2178,6 +2194,14 @@ def _html_edit_profile_options(is_admin: bool,
bold_str = bold_reading_string(translate['Bold reading'])
edit_profile_form += \
edit_check_box(bold_str, 'boldReading', bold_reading)
+ minimize_all_images = False
+ if nickname in min_images_for_accounts:
+ minimize_all_images = True
+ minimize_all_images_str = \
+ bold_reading_string(translate['Minimize all images'])
+ edit_profile_form += \
+ edit_check_box(minimize_all_images_str, 'minimizeAllImages',
+ minimize_all_images)
edit_profile_form += '
\n'
return edit_profile_form
@@ -2339,7 +2363,8 @@ def html_edit_profile(server, translate: {},
access_keys: {},
default_reply_interval_hrs: int,
cw_lists: {}, lists_enabled: str,
- system_language: str) -> str:
+ system_language: str,
+ min_images_for_accounts: []) -> str:
"""Shows the edit profile screen
"""
path = path.replace('/inbox', '').replace('/outbox', '')
@@ -2533,7 +2558,8 @@ def html_edit_profile(server, translate: {},
remove_twitter,
notify_likes, notify_reactions,
hide_like_button, hide_reaction_button,
- translate, bold_reading)
+ translate, bold_reading,
+ nickname, min_images_for_accounts)
# Contact information
edit_profile_form += \
diff --git a/webapp_search.py b/webapp_search.py
index e4fd17867..8f94cd0b1 100644
--- a/webapp_search.py
+++ b/webapp_search.py
@@ -695,7 +695,8 @@ def html_history_search(translate: {}, base_dir: str,
cw_lists: {},
lists_enabled: str,
timezone: str, bold_reading: bool,
- dogwhistles: {}, access_keys: {}) -> str:
+ dogwhistles: {}, access_keys: {},
+ min_images_for_accounts: []) -> str:
"""Show a page containing search results for your post history
"""
if historysearch.startswith("'"):
@@ -765,6 +766,9 @@ def html_history_search(translate: {}, base_dir: str,
end_index = no_of_box_filenames - 1
index = start_index
+ minimize_all_images = False
+ if nickname in min_images_for_accounts:
+ minimize_all_images = True
while index <= end_index:
post_filename = box_filenames[index]
if not post_filename:
@@ -800,7 +804,8 @@ def html_history_search(translate: {}, base_dir: str,
False, False, False, False,
cw_lists, lists_enabled,
timezone, False, bold_reading,
- dogwhistles)
+ dogwhistles,
+ minimize_all_images)
if post_str:
history_search_form += separator_str + post_str
index += 1
@@ -827,7 +832,8 @@ def html_hashtag_search(nickname: str, domain: str, port: int,
cw_lists: {}, lists_enabled: str,
timezone: str, bold_reading: bool,
dogwhistles: {}, map_format: str,
- access_keys: {}, box_name: str) -> str:
+ access_keys: {}, box_name: str,
+ min_images_for_accounts: []) -> str:
"""Show a page containing search results for a hashtag
or after selecting a hashtag from the swarm
"""
@@ -989,6 +995,9 @@ def html_hashtag_search(nickname: str, domain: str, port: int,
allow_downloads = True
avatar_url = None
show_avatar_options = True
+ minimize_all_images = False
+ if nickname in min_images_for_accounts:
+ minimize_all_images = True
post_str = \
individual_post_as_html(signing_priv_key_pem,
allow_downloads, recent_posts_cache,
@@ -1014,7 +1023,8 @@ def html_hashtag_search(nickname: str, domain: str, port: int,
show_public_only,
store_to_sache, False, cw_lists,
lists_enabled, timezone, False,
- bold_reading, dogwhistles)
+ bold_reading, dogwhistles,
+ minimize_all_images)
if post_str:
hashtag_search_form += separator_str + post_str
index += 1
diff --git a/webapp_timeline.py b/webapp_timeline.py
index be5c09774..645b2861c 100644
--- a/webapp_timeline.py
+++ b/webapp_timeline.py
@@ -498,7 +498,8 @@ def html_timeline(default_timeline: str,
signing_priv_key_pem: str,
cw_lists: {}, lists_enabled: str,
timezone: str, bold_reading: bool,
- dogwhistles: {}, ua_str: str) -> str:
+ dogwhistles: {}, ua_str: str,
+ min_images_for_accounts: []) -> str:
"""Show the timeline as html
"""
enable_timing_log = False
@@ -954,6 +955,10 @@ def html_timeline(default_timeline: str,
tl_str += '
'
tl_str += '\n'
+ minimize_all_images = False
+ if nickname in min_images_for_accounts:
+ minimize_all_images = True
+
# show each post in the timeline
for item in timeline_json['orderedItems']:
if item['type'] == 'Create' or \
@@ -1015,7 +1020,8 @@ def html_timeline(default_timeline: str,
False, True, use_cache_only,
cw_lists, lists_enabled,
timezone, mitm,
- bold_reading, dogwhistles)
+ bold_reading, dogwhistles,
+ minimize_all_images)
_log_timeline_timing(enable_timing_log,
timeline_start_time, box_name, '12')
@@ -1257,7 +1263,8 @@ def html_shares(default_timeline: str,
signing_priv_key_pem: str,
cw_lists: {}, lists_enabled: str,
timezone: str, bold_reading: bool,
- dogwhistles: {}, ua_str: str) -> str:
+ dogwhistles: {}, ua_str: str,
+ min_images_for_accounts: []) -> str:
"""Show the shares timeline as html
"""
manually_approve_followers = \
@@ -1288,7 +1295,8 @@ def html_shares(default_timeline: str,
shared_items_federated_domains,
signing_priv_key_pem,
cw_lists, lists_enabled, timezone,
- bold_reading, dogwhistles, ua_str)
+ bold_reading, dogwhistles, ua_str,
+ min_images_for_accounts)
def html_wanted(default_timeline: str,
@@ -1318,7 +1326,8 @@ def html_wanted(default_timeline: str,
signing_priv_key_pem: str,
cw_lists: {}, lists_enabled: str,
timezone: str, bold_reading: bool,
- dogwhistles: {}, ua_str: str) -> str:
+ dogwhistles: {}, ua_str: str,
+ min_images_for_accounts: []) -> str:
"""Show the wanted timeline as html
"""
manually_approve_followers = \
@@ -1349,7 +1358,8 @@ def html_wanted(default_timeline: str,
shared_items_federated_domains,
signing_priv_key_pem,
cw_lists, lists_enabled, timezone,
- bold_reading, dogwhistles, ua_str)
+ bold_reading, dogwhistles, ua_str,
+ min_images_for_accounts)
def html_inbox(default_timeline: str,
@@ -1380,7 +1390,8 @@ def html_inbox(default_timeline: str,
signing_priv_key_pem: str,
cw_lists: {}, lists_enabled: str,
timezone: str, bold_reading: bool,
- dogwhistles: {}, ua_str: str) -> str:
+ dogwhistles: {}, ua_str: str,
+ min_images_for_accounts: []) -> str:
"""Show the inbox as html
"""
manually_approve_followers = \
@@ -1411,7 +1422,8 @@ def html_inbox(default_timeline: str,
shared_items_federated_domains,
signing_priv_key_pem,
cw_lists, lists_enabled, timezone,
- bold_reading, dogwhistles, ua_str)
+ bold_reading, dogwhistles, ua_str,
+ min_images_for_accounts)
def html_bookmarks(default_timeline: str,
@@ -1442,7 +1454,8 @@ def html_bookmarks(default_timeline: str,
signing_priv_key_pem: str,
cw_lists: {}, lists_enabled: str,
timezone: str, bold_reading: bool,
- dogwhistles: {}, ua_str: str) -> str:
+ dogwhistles: {}, ua_str: str,
+ min_images_for_accounts: []) -> str:
"""Show the bookmarks as html
"""
manually_approve_followers = \
@@ -1472,7 +1485,8 @@ def html_bookmarks(default_timeline: str,
access_keys, system_language, max_like_count,
shared_items_federated_domains, signing_priv_key_pem,
cw_lists, lists_enabled, timezone,
- bold_reading, dogwhistles, ua_str)
+ bold_reading, dogwhistles, ua_str,
+ min_images_for_accounts)
def html_inbox_dms(default_timeline: str,
@@ -1503,7 +1517,8 @@ def html_inbox_dms(default_timeline: str,
signing_priv_key_pem: str,
cw_lists: {}, lists_enabled: str,
timezone: str, bold_reading: bool,
- dogwhistles: {}, ua_str: str) -> str:
+ dogwhistles: {}, ua_str: str,
+ min_images_for_accounts: []) -> str:
"""Show the DM timeline as html
"""
artist = is_artist(base_dir, nickname)
@@ -1529,7 +1544,8 @@ def html_inbox_dms(default_timeline: str,
shared_items_federated_domains,
signing_priv_key_pem,
cw_lists, lists_enabled, timezone,
- bold_reading, dogwhistles, ua_str)
+ bold_reading, dogwhistles, ua_str,
+ min_images_for_accounts)
def html_inbox_replies(default_timeline: str,
@@ -1560,7 +1576,8 @@ def html_inbox_replies(default_timeline: str,
signing_priv_key_pem: str,
cw_lists: {}, lists_enabled: str,
timezone: str, bold_reading: bool,
- dogwhistles: {}, ua_str: str) -> str:
+ dogwhistles: {}, ua_str: str,
+ min_images_for_accounts: []) -> str:
"""Show the replies timeline as html
"""
artist = is_artist(base_dir, nickname)
@@ -1585,7 +1602,7 @@ def html_inbox_replies(default_timeline: str,
access_keys, system_language, max_like_count,
shared_items_federated_domains, signing_priv_key_pem,
cw_lists, lists_enabled, timezone, bold_reading,
- dogwhistles, ua_str)
+ dogwhistles, ua_str, min_images_for_accounts)
def html_inbox_media(default_timeline: str,
@@ -1616,7 +1633,8 @@ def html_inbox_media(default_timeline: str,
signing_priv_key_pem: str,
cw_lists: {}, lists_enabled: str,
timezone: str, bold_reading: bool,
- dogwhistles: {}, ua_str: str) -> str:
+ dogwhistles: {}, ua_str: str,
+ min_images_for_accounts: []) -> str:
"""Show the media timeline as html
"""
artist = is_artist(base_dir, nickname)
@@ -1641,7 +1659,7 @@ def html_inbox_media(default_timeline: str,
access_keys, system_language, max_like_count,
shared_items_federated_domains, signing_priv_key_pem,
cw_lists, lists_enabled, timezone, bold_reading,
- dogwhistles, ua_str)
+ dogwhistles, ua_str, min_images_for_accounts)
def html_inbox_blogs(default_timeline: str,
@@ -1672,7 +1690,8 @@ def html_inbox_blogs(default_timeline: str,
signing_priv_key_pem: str,
cw_lists: {}, lists_enabled: str,
timezone: str, bold_reading: bool,
- dogwhistles: {}, ua_str: str) -> str:
+ dogwhistles: {}, ua_str: str,
+ min_images_for_accounts: []) -> str:
"""Show the blogs timeline as html
"""
artist = is_artist(base_dir, nickname)
@@ -1697,7 +1716,7 @@ def html_inbox_blogs(default_timeline: str,
access_keys, system_language, max_like_count,
shared_items_federated_domains, signing_priv_key_pem,
cw_lists, lists_enabled, timezone, bold_reading,
- dogwhistles, ua_str)
+ dogwhistles, ua_str, min_images_for_accounts)
def html_inbox_features(default_timeline: str,
@@ -1729,7 +1748,8 @@ def html_inbox_features(default_timeline: str,
signing_priv_key_pem: str,
cw_lists: {}, lists_enabled: str,
timezone: str, bold_reading: bool,
- dogwhistles: {}, ua_str: str) -> str:
+ dogwhistles: {}, ua_str: str,
+ min_images_for_accounts: []) -> str:
"""Show the features timeline as html
"""
return html_timeline(default_timeline,
@@ -1753,7 +1773,7 @@ def html_inbox_features(default_timeline: str,
access_keys, system_language, max_like_count,
shared_items_federated_domains, signing_priv_key_pem,
cw_lists, lists_enabled, timezone, bold_reading,
- dogwhistles, ua_str)
+ dogwhistles, ua_str, min_images_for_accounts)
def html_inbox_news(default_timeline: str,
@@ -1784,7 +1804,8 @@ def html_inbox_news(default_timeline: str,
signing_priv_key_pem: str,
cw_lists: {}, lists_enabled: str,
timezone: str, bold_reading: bool,
- dogwhistles: {}, ua_str: str) -> str:
+ dogwhistles: {}, ua_str: str,
+ min_images_for_accounts: []) -> str:
"""Show the news timeline as html
"""
return html_timeline(default_timeline,
@@ -1808,7 +1829,7 @@ def html_inbox_news(default_timeline: str,
access_keys, system_language, max_like_count,
shared_items_federated_domains, signing_priv_key_pem,
cw_lists, lists_enabled, timezone, bold_reading,
- dogwhistles, ua_str)
+ dogwhistles, ua_str, min_images_for_accounts)
def html_outbox(default_timeline: str,
@@ -1839,7 +1860,8 @@ def html_outbox(default_timeline: str,
signing_priv_key_pem: str,
cw_lists: {}, lists_enabled: str,
timezone: str, bold_reading: bool,
- dogwhistles: {}, ua_str: str) -> str:
+ dogwhistles: {}, ua_str: str,
+ min_images_for_accounts: []) -> str:
"""Show the Outbox as html
"""
manually_approve_followers = \
@@ -1866,4 +1888,4 @@ def html_outbox(default_timeline: str,
access_keys, system_language, max_like_count,
shared_items_federated_domains, signing_priv_key_pem,
cw_lists, lists_enabled, timezone, bold_reading,
- dogwhistles, ua_str)
+ dogwhistles, ua_str, min_images_for_accounts)
diff --git a/webapp_utils.py b/webapp_utils.py
index f57c2c0f4..b9ae21dae 100644
--- a/webapp_utils.py
+++ b/webapp_utils.py
@@ -1204,7 +1204,8 @@ def get_post_attachments_as_html(base_dir: str,
like_str: str,
bookmark_str: str, delete_str: str,
mute_str: str,
- content: str) -> (str, str):
+ content: str,
+ minimize_all_images: bool) -> (str, str):
"""Returns a string representing any attachments
"""
attachment_str = ''
@@ -1292,6 +1293,8 @@ def get_post_attachments_as_html(base_dir: str,
# optionally hide the image
attributed_actor = None
minimize_images = False
+ if minimize_all_images:
+ minimize_images = True
if post_json_object['object'].get('attributedTo'):
if isinstance(post_json_object['object']['attributedTo'],
str):
@@ -1302,10 +1305,14 @@ def get_post_attachments_as_html(base_dir: str,
get_nickname_from_actor(attributed_actor)
following_domain, _ = \
get_domain_from_actor(attributed_actor)
- minimize_images = \
- minimizing_attached_images(base_dir, nickname, domain,
- following_nickname,
- following_domain)
+ if minimize_all_images:
+ minimize_images = True
+ else:
+ minimize_images = \
+ minimizing_attached_images(base_dir,
+ nickname, domain,
+ following_nickname,
+ following_domain)
# minimize any NSFW images
if not minimize_images and content: