Handle logging <destroy/> with no reason nor altroom

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2021-12-25 00:14:49 +01:00
parent 7e3d9c0dcb
commit db9b423000
Signed by: pep
GPG key ID: DEDA74AEECA9D0F2

View file

@ -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: