Use note of type=error to signal an error

This commit is contained in:
Stephen Paul Weber 2024-02-13 15:26:05 -05:00
parent d3af15d623
commit d410ef8ab3
No known key found for this signature in database
GPG key ID: D11C2911CE519CDE

View file

@ -773,6 +773,7 @@ class Slixfeed(slixmpp.ClientXMPP):
options.addOption(conference['name'], conference['jid']) options.addOption(conference['name'], conference['jid'])
session['next'] = self._handle_bookmarks_editor session['next'] = self._handle_bookmarks_editor
session['has_next'] = True session['has_next'] = True
session['payload'] = form
else: else:
logging.warning('An unauthorized attempt to access bookmarks has ' logging.warning('An unauthorized attempt to access bookmarks has '
'been detected!\n' 'been detected!\n'
@ -780,16 +781,7 @@ class Slixfeed(slixmpp.ClientXMPP):
' Jabber ID: {}\n' ' Jabber ID: {}\n'
' Timestamp: {}\n' ' Timestamp: {}\n'
.format(jid, timestamp())) .format(jid, timestamp()))
form = self['xep_0004'].make_form('form', 'Denied') session['notes'] = [['error', 'You are not allowed to access this resource.']]
# form = self['xep_0004'].make_form('error', 'Denied') # Cheogram crashes
form['instructions'] = '⚠️ Access denied'
form.add_field(var='warning',
ftype='fixed',
label='Warning',
value='You are not allowed to access this resource.')
session['next'] = False
session['has_next'] = False
session['payload'] = form
return session return session