summaryrefslogtreecommitdiff
path: root/poezio
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2020-05-24 15:25:59 +0200
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2020-05-24 15:57:40 +0200
commitee0caff6ca13f299fe72404711eae2017a708de9 (patch)
treed3b5163cd999d7c8aac2dcf4bb71e63a8c9558b0 /poezio
parent95d4de917ddbd0f09c612bb762963cd9279006e6 (diff)
downloadpoezio-ee0caff6ca13f299fe72404711eae2017a708de9.tar.gz
poezio-ee0caff6ca13f299fe72404711eae2017a708de9.tar.bz2
poezio-ee0caff6ca13f299fe72404711eae2017a708de9.tar.xz
poezio-ee0caff6ca13f299fe72404711eae2017a708de9.zip
Add a /leave command
This is the other side of /join when bookmark_on_join is set to true. It lets the user easily leave a bookmarked MUC from all of their clients at once.
Diffstat (limited to 'poezio')
-rw-r--r--poezio/tabs/muctab.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/poezio/tabs/muctab.py b/poezio/tabs/muctab.py
index 751509a7..b37b725e 100644
--- a/poezio/tabs/muctab.py
+++ b/poezio/tabs/muctab.py
@@ -1484,6 +1484,17 @@ class MucTab(ChatTab):
self.core.doupdate()
@command_args_parser.raw
+ def command_leave(self, msg):
+ """
+ /leave [msg]
+ """
+ self.leave_room(msg)
+ if config.get('bookmark_on_join'):
+ self.core.bookmarks.remove(self.jid)
+ self.core.bookmarks.save(self.core.xmpp)
+ self.core.close_tab(self)
+
+ @command_args_parser.raw
def command_close(self, msg):
"""
/close [msg]
@@ -2074,6 +2085,13 @@ class MucTab(ChatTab):
'shortdesc':
'Leave the room.'
}, {
+ 'name': 'leave',
+ 'func': self.command_leave,
+ 'usage': '[message]',
+ 'desc': ('Disconnect from a room, on all of your clients. '
+ 'You can specify an optional message'),
+ 'shortdesc': 'Leave the room.'
+ }, {
'name':
'close',
'func':