summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core.py12
-rw-r--r--src/tabs.py2
2 files changed, 13 insertions, 1 deletions
diff --git a/src/core.py b/src/core.py
index 96531e5f..3cdc7592 100644
--- a/src/core.py
+++ b/src/core.py
@@ -1325,6 +1325,18 @@ class Core(object):
r.users = []
self.enable_private_tabs(room)
+ def get_bookmark_nickname(self, room_name):
+ """
+ Returns the nickname associated with a bookmark
+ or the default nickname
+ """
+ bookmarks = config.get('rooms', '').split(':')
+ jid = JID(room_name)
+ for bookmark in bookmarks:
+ if JID(bookmark).bare == jid.bare:
+ return JID(bookmark).resource
+ return self.own_nick
+
def command_bookmark(self, arg):
"""
/bookmark [room][/nick]
diff --git a/src/tabs.py b/src/tabs.py
index 5c141f51..24f347ba 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -453,7 +453,7 @@ class MucTab(ChatTab):
muc.leave_groupchat(self.core.xmpp, self.get_name(), self.get_room().own_nick, arg)
self.get_room().disconnect()
self.core.disable_private_tabs(self.get_room().name)
- self.core.command_join('/', "0")
+ self.core.command_join('/%s' % self.core.get_bookmark_nickname(self.get_room().name), '0')
self.user_win.pos = 0
def command_recolor(self, arg):