From 26c075ee7cd46417bfa9513f55e9e8c502a3cc8d Mon Sep 17 00:00:00 2001 From: bashrc Date: Mon, 2 Mar 2026 16:09:27 +0000 Subject: [PATCH] Show lxmf qrcode on profile --- daemon_get.py | 8 +++++--- daemon_get_images.py | 30 +++++++++++++++++------------- webapp_person_options.py | 8 +++++++- webapp_profile.py | 9 ++++++++- 4 files changed, 37 insertions(+), 18 deletions(-) diff --git a/daemon_get.py b/daemon_get.py index 650c72745..82173613a 100644 --- a/daemon_get.py +++ b/daemon_get.py @@ -2709,7 +2709,8 @@ def daemon_http_get(self) -> None: # image on login screen or qrcode if is_image_file(self.path) and \ - (string_starts_with(self.path, ('/login.', '/qrcode.png'))): + (string_starts_with(self.path, + ('/login.', '/qrcode.png', '/qrcode_lxmf.png'))): icon_filename = data_dir(self.server.base_dir) + self.path if os.path.isfile(icon_filename): if etag_exists(self, icon_filename): @@ -2749,8 +2750,9 @@ def daemon_http_get(self) -> None: self.server.debug) # QR code for account handle - if users_in_path and \ - self.path.endswith('/qrcode.png'): + if (users_in_path and + (self.path.endswith('/qrcode.png') or + self.path.endswith('/qrcode_lxmf.png'))): if show_qrcode(self, calling_domain, self.path, self.server.base_dir, self.server.domain, diff --git a/daemon_get_images.py b/daemon_get_images.py index 83890da70..eb69b7aab 100644 --- a/daemon_get_images.py +++ b/daemon_get_images.py @@ -495,20 +495,24 @@ def show_qrcode(self, calling_domain: str, path: str, if not nickname: http_404(self, 93) return True - if onion_domain: - qrcode_domain = onion_domain - port = 80 - elif i2p_domain: - qrcode_domain = i2p_domain - port = 80 - elif yggdrasil_domain: - qrcode_domain = yggdrasil_domain - port = 80 + if path.endswith('_lxmf.png'): + qr_filename = \ + acct_dir(base_dir, nickname, domain) + '/qrcode_lxmf.png' else: - qrcode_domain = domain - save_person_qrcode(base_dir, nickname, domain, qrcode_domain, port) - qr_filename = \ - acct_dir(base_dir, nickname, domain) + '/qrcode.png' + if onion_domain: + qrcode_domain = onion_domain + port = 80 + elif i2p_domain: + qrcode_domain = i2p_domain + port = 80 + elif yggdrasil_domain: + qrcode_domain = yggdrasil_domain + port = 80 + else: + qrcode_domain = domain + save_person_qrcode(base_dir, nickname, domain, qrcode_domain, port) + qr_filename = \ + acct_dir(base_dir, nickname, domain) + '/qrcode.png' if os.path.isfile(qr_filename): if etag_exists(self, qr_filename): # The file has not changed diff --git a/webapp_person_options.py b/webapp_person_options.py index e0bd3ac0e..c8869bb77 100644 --- a/webapp_person_options.py +++ b/webapp_person_options.py @@ -499,7 +499,13 @@ def html_person_options(default_timeline: str, '

Tox: ' + remove_html(tox_address) + '

\n' if lxmf_address: options_str += \ - '

LXMF: ' + remove_html(lxmf_address) + '

\n' + '

LXMF: ' + remove_html(lxmf_address) + options_str += \ + ' ' + \ + '' + translate['QR Code'] + \
+            '

\n' if briar_address: if briar_address.startswith('briar://'): options_str += \ diff --git a/webapp_profile.py b/webapp_profile.py index 8c088f80c..40ea4e9fb 100644 --- a/webapp_profile.py +++ b/webapp_profile.py @@ -1421,7 +1421,14 @@ def html_profile(signing_priv_key_pem: str, if lxmf_address: donate_section += \ '

LXMF:

\n' + lxmf_address + '' + donate_section += \ + ' ' + \ + '' + translate['QR Code'] + \
+                '

\n' if briar_address: if briar_address.startswith('briar://'): donate_section += \