From b8729095790e85383e946ba085bef1086306b229 Mon Sep 17 00:00:00 2001 From: mathieui Date: Sat, 13 Mar 2021 21:26:30 +0100 Subject: fix: do not crash on /invitations (but only if an invalid JID is in there, I guess) --- poezio/core/commands.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'poezio/core/commands.py') diff --git a/poezio/core/commands.py b/poezio/core/commands.py index 46a95d33..d07c2e1e 100644 --- a/poezio/core/commands.py +++ b/poezio/core/commands.py @@ -1112,12 +1112,15 @@ class CommandCore: def invitations(self): """/invitations""" build = [] - for invite in self.core.pending_invites: + for room, inviter in self.core.pending_invites.items(): try: - bare = JID(self.core.pending_invites[invite]).bare + bare = JID(inviter).bare except InvalidJID: - self.core.information('Invalid JID found in /invitations: %s' % args[0], 'Error') - build.append('%s by %s' % (invite, bare)) + self.core.information( + f'Invalid JID found in /invitations: {inviter}', + 'Error' + ) + build.append(f'{room} by {bare}') if build: message = 'You are invited to the following rooms:\n' + ','.join(build) else: -- cgit v1.2.3