From db9b423000e9a1b0c595a49d69d8e723eeafed3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Sat, 25 Dec 2021 00:14:49 +0100 Subject: Handle logging with no reason nor altroom MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- poezio/tabs/muctab.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/poezio/tabs/muctab.py b/poezio/tabs/muctab.py index d06bf21f..8f70faf5 100644 --- a/poezio/tabs/muctab.py +++ b/poezio/tabs/muctab.py @@ -664,13 +664,14 @@ class MucTab(ChatTab): JID(from_room), server_initiated) ns = 'http://jabber.org/protocol/muc#user' if presence.xml.find(f'{{{ns}}}x/{{{ns}}}destroy') is not None: - reason = presence['muc']['destroy']['reason'] - altroom = presence['muc']['destroy']['jid'] info = f'Room {self.jid} was destroyed.' - if reason: - info += f' “{reason}”.' - if altroom: - info += f' The new address now is {altroom}.' + if presence['muc']['destroy']: + reason = presence['muc']['destroy']['reason'] + altroom = presence['muc']['destroy']['jid'] + if reason: + info += f' “{reason}”.' + if altroom: + info += f' The new address now is {altroom}.' self.core.information(info, 'Info') # status change else: -- cgit v1.2.3