mirror of https://gitlab.com/bashrc2/epicyon
Show lxmf qrcode on profile
parent
8bd9f99cfd
commit
26c075ee7c
|
|
@ -2709,7 +2709,8 @@ def daemon_http_get(self) -> None:
|
||||||
|
|
||||||
# image on login screen or qrcode
|
# image on login screen or qrcode
|
||||||
if is_image_file(self.path) and \
|
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
|
icon_filename = data_dir(self.server.base_dir) + self.path
|
||||||
if os.path.isfile(icon_filename):
|
if os.path.isfile(icon_filename):
|
||||||
if etag_exists(self, icon_filename):
|
if etag_exists(self, icon_filename):
|
||||||
|
|
@ -2749,8 +2750,9 @@ def daemon_http_get(self) -> None:
|
||||||
self.server.debug)
|
self.server.debug)
|
||||||
|
|
||||||
# QR code for account handle
|
# QR code for account handle
|
||||||
if users_in_path and \
|
if (users_in_path and
|
||||||
self.path.endswith('/qrcode.png'):
|
(self.path.endswith('/qrcode.png') or
|
||||||
|
self.path.endswith('/qrcode_lxmf.png'))):
|
||||||
if show_qrcode(self, calling_domain, self.path,
|
if show_qrcode(self, calling_domain, self.path,
|
||||||
self.server.base_dir,
|
self.server.base_dir,
|
||||||
self.server.domain,
|
self.server.domain,
|
||||||
|
|
|
||||||
|
|
@ -495,6 +495,10 @@ def show_qrcode(self, calling_domain: str, path: str,
|
||||||
if not nickname:
|
if not nickname:
|
||||||
http_404(self, 93)
|
http_404(self, 93)
|
||||||
return True
|
return True
|
||||||
|
if path.endswith('_lxmf.png'):
|
||||||
|
qr_filename = \
|
||||||
|
acct_dir(base_dir, nickname, domain) + '/qrcode_lxmf.png'
|
||||||
|
else:
|
||||||
if onion_domain:
|
if onion_domain:
|
||||||
qrcode_domain = onion_domain
|
qrcode_domain = onion_domain
|
||||||
port = 80
|
port = 80
|
||||||
|
|
|
||||||
|
|
@ -499,7 +499,13 @@ def html_person_options(default_timeline: str,
|
||||||
' <p class="imText">Tox: ' + remove_html(tox_address) + '</p>\n'
|
' <p class="imText">Tox: ' + remove_html(tox_address) + '</p>\n'
|
||||||
if lxmf_address:
|
if lxmf_address:
|
||||||
options_str += \
|
options_str += \
|
||||||
' <p class="imText">LXMF: ' + remove_html(lxmf_address) + '</p>\n'
|
' <p class="imText">LXMF: ' + remove_html(lxmf_address)
|
||||||
|
options_str += \
|
||||||
|
' <a href="/users/' + nickname + \
|
||||||
|
'/qrcode_lxmf.png" alt="' + translate['QR Code'] + '" title="' + \
|
||||||
|
translate['QR Code'] + '" tabindex="1">' + \
|
||||||
|
'<img class="qrcode" alt="' + translate['QR Code'] + \
|
||||||
|
'" src="/icons/qrcode_lxmf.png" /></a></p>\n'
|
||||||
if briar_address:
|
if briar_address:
|
||||||
if briar_address.startswith('briar://'):
|
if briar_address.startswith('briar://'):
|
||||||
options_str += \
|
options_str += \
|
||||||
|
|
|
||||||
|
|
@ -1421,7 +1421,14 @@ def html_profile(signing_priv_key_pem: str,
|
||||||
if lxmf_address:
|
if lxmf_address:
|
||||||
donate_section += \
|
donate_section += \
|
||||||
'<p>LXMF: <label class="toxaddr">' + \
|
'<p>LXMF: <label class="toxaddr">' + \
|
||||||
lxmf_address + '</label></p>\n'
|
lxmf_address + '</label>'
|
||||||
|
donate_section += \
|
||||||
|
' <a href="/users/' + nickname + \
|
||||||
|
'/qrcode_lxmf.png" alt="' + translate['QR Code'] + \
|
||||||
|
'" title="' + \
|
||||||
|
translate['QR Code'] + '" tabindex="1">' + \
|
||||||
|
'<img class="qrcode" alt="' + translate['QR Code'] + \
|
||||||
|
'" src="/icons/qrcode_lxmf.png" /></a></p>\n'
|
||||||
if briar_address:
|
if briar_address:
|
||||||
if briar_address.startswith('briar://'):
|
if briar_address.startswith('briar://'):
|
||||||
donate_section += \
|
donate_section += \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue