summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime “pep” Buquet <pep@bouah.net>2021-12-19 00:54:48 +0100
committerLink Mauve <linkmauve@linkmauve.fr>2021-12-22 18:20:12 +0100
commit1b7c6a79b50958aad03bac789e41224a2c866576 (patch)
treed8515fb006f2ac44f6919df8b5cd5b44914380d9
parent01b9f37dac2f5f1e976704e30c0c1f6e30755146 (diff)
downloadpoezio-1b7c6a79b50958aad03bac789e41224a2c866576.tar.gz
poezio-1b7c6a79b50958aad03bac789e41224a2c866576.tar.bz2
poezio-1b7c6a79b50958aad03bac789e41224a2c866576.tar.xz
poezio-1b7c6a79b50958aad03bac789e41224a2c866576.zip
Log <destroy/> payload in the info buffer
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
-rw-r--r--poezio/tabs/muctab.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/poezio/tabs/muctab.py b/poezio/tabs/muctab.py
index 8acb9773..d06bf21f 100644
--- a/poezio/tabs/muctab.py
+++ b/poezio/tabs/muctab.py
@@ -662,6 +662,16 @@ class MucTab(ChatTab):
elif typ == 'unavailable':
self.on_user_leave_groupchat(user, jid, status, from_nick,
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}.'
+ self.core.information(info, 'Info')
# status change
else:
self.on_user_change_status(user, from_nick, from_room, affiliation,