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
|
||||
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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -499,7 +499,13 @@ def html_person_options(default_timeline: str,
|
|||
' <p class="imText">Tox: ' + remove_html(tox_address) + '</p>\n'
|
||||
if lxmf_address:
|
||||
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.startswith('briar://'):
|
||||
options_str += \
|
||||
|
|
|
|||
|
|
@ -1421,7 +1421,14 @@ def html_profile(signing_priv_key_pem: str,
|
|||
if lxmf_address:
|
||||
donate_section += \
|
||||
'<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.startswith('briar://'):
|
||||
donate_section += \
|
||||
|
|
|
|||
Loading…
Reference in New Issue