From 5f946fe0b6b0690af0bb04919e9a2bb08a98b798 Mon Sep 17 00:00:00 2001 From: Schimon Jehudah Date: Tue, 26 Mar 2024 19:32:24 +0000 Subject: [PATCH] Fix error upon attempt to get JID from values['jid'] (Thank you roughnecks). --- slixfeed/version.py | 4 ++-- slixfeed/xmpp/client.py | 3 ++- slixfeed/xmpp/component.py | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/slixfeed/version.py b/slixfeed/version.py index 7487e2f..cd05de4 100644 --- a/slixfeed/version.py +++ b/slixfeed/version.py @@ -1,2 +1,2 @@ -__version__ = '0.1.49' -__version_info__ = (0, 1, 49) +__version__ = '0.1.50' +__version_info__ = (0, 1, 50) diff --git a/slixfeed/xmpp/client.py b/slixfeed/xmpp/client.py index 848bdc5..b47c7f3 100644 --- a/slixfeed/xmpp/client.py +++ b/slixfeed/xmpp/client.py @@ -1523,7 +1523,7 @@ class Slixfeed(slixmpp.ClientXMPP): values = payload['values'] node = values['node'] if 'node' in values else None url = values['subscription'] - jid = values['jid'] + jid = values['jid'] if 'jid' in values else None jid_bare = session['from'].bare if is_operator(self, jid_bare) and jid: jid_file = jid[0] if isinstance(jid, list) else jid @@ -2810,6 +2810,7 @@ class Slixfeed(slixmpp.ClientXMPP): await Config.set_setting_value(self.settings, jid_bare, db_file, 'enabled', value) print(self.settings) text_note = 'Done.' + session['has_next'] = False session['next'] = None session['notes'] = [['info', text_note]] session['payload'] = None diff --git a/slixfeed/xmpp/component.py b/slixfeed/xmpp/component.py index f5d9509..609fc8a 100644 --- a/slixfeed/xmpp/component.py +++ b/slixfeed/xmpp/component.py @@ -1484,7 +1484,7 @@ class SlixfeedComponent(slixmpp.ComponentXMPP): values = payload['values'] node = values['node'] if 'node' in values else None url = values['subscription'] - jid = values['jid'] + jid = values['jid'] if 'jid' in values else None jid_bare = session['from'].bare if is_operator(self, jid_bare) and jid: jid_file = jid[0] if isinstance(jid, list) else jid @@ -2771,6 +2771,7 @@ class SlixfeedComponent(slixmpp.ComponentXMPP): await Config.set_setting_value(self.settings, jid_bare, db_file, 'enabled', value) print(self.settings) text_note = 'Done.' + session['has_next'] = False session['next'] = None session['notes'] = [['info', text_note]] session['payload'] = None