summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2011-09-21 17:44:41 +0200
committermathieui <mathieui@mathieui.net>2011-09-21 17:44:41 +0200
commitf34d3172a11190ebfd8030deb5771a55fdb57476 (patch)
tree30747cbea5038865f07f909c3f71fda90ce9335b /src
parent46705e18611cf49e5c0b45ce51ced221b0162167 (diff)
downloadpoezio-f34d3172a11190ebfd8030deb5771a55fdb57476.tar.gz
poezio-f34d3172a11190ebfd8030deb5771a55fdb57476.tar.bz2
poezio-f34d3172a11190ebfd8030deb5771a55fdb57476.tar.xz
poezio-f34d3172a11190ebfd8030deb5771a55fdb57476.zip
Fixes #2251
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):