diff options
author | mathieui <mathieui@mathieui.net> | 2020-05-24 16:03:05 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2020-05-24 16:03:05 +0200 |
commit | 0a5625ea5d24a4cb954ab6452168d42930b03757 (patch) | |
tree | 3813249db2cfbf5f408fe15e3fca3e61bf11b696 | |
parent | 95498a39105da1d9a831a4ea231c801c62b1a945 (diff) | |
parent | ee0caff6ca13f299fe72404711eae2017a708de9 (diff) | |
download | poezio-0a5625ea5d24a4cb954ab6452168d42930b03757.tar.gz poezio-0a5625ea5d24a4cb954ab6452168d42930b03757.tar.bz2 poezio-0a5625ea5d24a4cb954ab6452168d42930b03757.tar.xz poezio-0a5625ea5d24a4cb954ab6452168d42930b03757.zip |
Merge branch 'command-leave' into 'master'
Add a /leave command
See merge request poezio/poezio!109
-rw-r--r-- | doc/source/commands.rst | 18 | ||||
-rw-r--r-- | poezio/tabs/muctab.py | 18 |
2 files changed, 36 insertions, 0 deletions
diff --git a/doc/source/commands.rst b/doc/source/commands.rst index 5ea69abd..4b277e4a 100644 --- a/doc/source/commands.rst +++ b/doc/source/commands.rst @@ -426,6 +426,24 @@ MultiUserChat tab commands Disconnect you from a room. You can specify an optional message. + This is similar to :term:`/leave`, but keeps the tab open and doesn’t + remove the bookmark, so restarting poezio or another client will reopen + this room. + + /leave + **Usage:** ``/leave [message]`` + + Disconnect you from a room, on all of your clients. You can specify an + optional message. + + This is similar to :term:`/part`, but closes the tab and removes its + bookmark, to make sure we don’t come back to this room the next time we + open poezio or another client. + + This is similar to :term:`/close`, but also removes the bookmark to + make sure we don’t come back to this room the next time we open poezio + or another client. + /nick **Usage:** ``/nick <nickname>`` 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': |