diff options
author | Maxime “pep” Buquet <pep@bouah.net> | 2021-12-25 00:14:49 +0100 |
---|---|---|
committer | Maxime “pep” Buquet <pep@bouah.net> | 2021-12-25 00:14:49 +0100 |
commit | db9b423000e9a1b0c595a49d69d8e723eeafed3d (patch) | |
tree | 3b4cb439f6006df8dcf6d76ecb73587f9f05b50c | |
parent | 7e3d9c0dcb3f3cf805cd488ae6f08811d9245ecc (diff) | |
download | poezio-db9b423000e9a1b0c595a49d69d8e723eeafed3d.tar.gz poezio-db9b423000e9a1b0c595a49d69d8e723eeafed3d.tar.bz2 poezio-db9b423000e9a1b0c595a49d69d8e723eeafed3d.tar.xz poezio-db9b423000e9a1b0c595a49d69d8e723eeafed3d.zip |
Handle logging <destroy/> with no reason nor altroom
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
-rw-r--r-- | poezio/tabs/muctab.py | 13 |
1 files 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: |