Don't include known addresses list in text mode browsers which don't support it

main
Bob Mottram 2025-11-29 14:12:47 +00:00
parent 3e6b4c8251
commit 9ad73fd6bb
4 changed files with 35 additions and 18 deletions

View File

@ -4514,7 +4514,8 @@ def daemon_http_get(self) -> None:
self.server.auto_cw_cache, self.server.auto_cw_cache,
self.server.searchable_by_default, self.server.searchable_by_default,
self.server.mitm_servers, self.server.mitm_servers,
self.server.instance_software): self.server.instance_software,
ua_str):
self.server.getreq_busy = False self.server.getreq_busy = False
return return

View File

@ -413,7 +413,8 @@ def show_new_post(self, edit_post_params: {},
auto_cw_cache: {}, auto_cw_cache: {},
searchable_by_default_dict: [], searchable_by_default_dict: [],
mitm_servers: [], mitm_servers: [],
instance_software: {}) -> bool: instance_software: {},
ua_str: str) -> bool:
"""Shows the new post screen """Shows the new post screen
""" """
searchable_by_default = 'yourself' searchable_by_default = 'yourself'
@ -541,7 +542,8 @@ def show_new_post(self, edit_post_params: {},
auto_cw_cache, auto_cw_cache,
searchable_by_default, searchable_by_default,
mitm_servers, mitm_servers,
instance_software) instance_software,
ua_str)
if not msg: if not msg:
print('Error replying to ' + in_reply_to_url) print('Error replying to ' + in_reply_to_url)
http_404(self, 104) http_404(self, 104)

View File

@ -922,7 +922,8 @@ def _person_options_dm(self, options_confirm_params: str,
cookie: str, calling_domain: str, cookie: str, calling_domain: str,
access_keys: {}, access_keys: {},
mitm_servers: [], mitm_servers: [],
instance_software: {}) -> bool: instance_software: {},
ua_str: str) -> bool:
"""Person options screen, DM button """Person options screen, DM button
See html_person_options See html_person_options
""" """
@ -1005,7 +1006,8 @@ def _person_options_dm(self, options_confirm_params: str,
auto_cw_cache, auto_cw_cache,
searchable_by_default, searchable_by_default,
mitm_servers, mitm_servers,
instance_software) instance_software,
ua_str)
if msg: if msg:
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
msglen = len(msg) msglen = len(msg)
@ -1163,7 +1165,8 @@ def _person_options_report(self, options_confirm_params: str,
cookie: str, calling_domain: str, cookie: str, calling_domain: str,
access_keys: {}, access_keys: {},
mitm_servers: [], mitm_servers: [],
instance_software: {}) -> bool: instance_software: {},
ua_str: str) -> bool:
"""Person options screen, report button """Person options screen, report button
See html_person_options See html_person_options
""" """
@ -1246,7 +1249,8 @@ def _person_options_report(self, options_confirm_params: str,
auto_cw_cache, auto_cw_cache,
searchable_by_default, searchable_by_default,
mitm_servers, mitm_servers,
instance_software) instance_software,
ua_str)
if msg: if msg:
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
msglen = len(msg) msglen = len(msg)
@ -1641,7 +1645,8 @@ def person_options2(self, path: str,
cookie, calling_domain, cookie, calling_domain,
access_keys, access_keys,
mitm_servers, mitm_servers,
instance_software): instance_software,
ua_str):
return return
if _person_options_info(self, options_confirm_params, if _person_options_info(self, options_confirm_params,
@ -1711,7 +1716,8 @@ def person_options2(self, path: str,
cookie, calling_domain, cookie, calling_domain,
access_keys, access_keys,
mitm_servers, mitm_servers,
instance_software): instance_software,
ua_str):
return return
# redirect back from person options screen # redirect back from person options screen

View File

@ -52,6 +52,7 @@ from maps import get_map_preferences_coords
from maps import get_location_from_post from maps import get_location_from_post
from cache import get_person_from_cache from cache import get_person_from_cache
from person import get_person_notes from person import get_person_notes
from textmode import text_mode_browser
def _html_new_post_drop_down(scope_icon: str, scope_description: str, def _html_new_post_drop_down(scope_icon: str, scope_description: str,
@ -278,7 +279,8 @@ def html_new_post(edit_post_params: {},
auto_cw_cache: {}, auto_cw_cache: {},
searchable_by_default: str, searchable_by_default: str,
mitm_servers: [], mitm_servers: [],
instance_software: {}) -> str: instance_software: {},
ua_str: str) -> str:
"""New post screen """New post screen
""" """
# get the json if this is an edited post # get the json if this is an edited post
@ -1116,14 +1118,20 @@ def html_new_post(edit_post_params: {},
'https://www.openstreetmap.org/#map=') + '</p>\n' 'https://www.openstreetmap.org/#map=') + '</p>\n'
# event address # event address
date_and_location += \ # The list of known addresses doesn't work in text mode browsers
'<label class="labels">' + translate['Address'] + ':' + \ if not text_mode_browser(ua_str):
'</label><br>\n' date_and_location += \
date_and_location += \ '<label class="labels">' + translate['Address'] + ':' + \
'<input type="text" name="locationAddress" ' + \ '</label><br>\n'
'list="addressbook">\n' date_and_location += \
date_and_location += \ '<input type="text" name="locationAddress" ' + \
html_address_book_list(base_dir, nickname, domain) 'list="addressbook">\n'
date_and_location += \
html_address_book_list(base_dir, nickname, domain)
else:
date_and_location += \
edit_text_field(translate['Address'], 'locationAddress',
'', '') + '</p>\n'
date_and_location += end_edit_section() date_and_location += end_edit_section()