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.
This commit is contained in:
parent
95d4de917d
commit
ee0caff6ca
2 changed files with 36 additions and 0 deletions
|
@ -426,6 +426,24 @@ MultiUserChat tab commands
|
||||||
Disconnect you from a room. You can specify an optional
|
Disconnect you from a room. You can specify an optional
|
||||||
message.
|
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
|
/nick
|
||||||
**Usage:** ``/nick <nickname>``
|
**Usage:** ``/nick <nickname>``
|
||||||
|
|
||||||
|
|
|
@ -1483,6 +1483,17 @@ class MucTab(ChatTab):
|
||||||
self.refresh()
|
self.refresh()
|
||||||
self.core.doupdate()
|
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
|
@command_args_parser.raw
|
||||||
def command_close(self, msg):
|
def command_close(self, msg):
|
||||||
"""
|
"""
|
||||||
|
@ -2073,6 +2084,13 @@ class MucTab(ChatTab):
|
||||||
' specify an optional message.'),
|
' specify an optional message.'),
|
||||||
'shortdesc':
|
'shortdesc':
|
||||||
'Leave the room.'
|
'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':
|
'name':
|
||||||
'close',
|
'close',
|
||||||
|
|
Loading…
Reference in a new issue