summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2015-04-14 01:34:24 +0200
committermathieui <mathieui@mathieui.net>2015-04-14 01:34:24 +0200
commite78ed92ba36829b89007fe390e8b19b2b59514e3 (patch)
tree0ca15e976d05689adacfb594e1cae93d3e74a072 /src/core
parent64ec234f6b111b1fade558060d0854f256024316 (diff)
downloadpoezio-e78ed92ba36829b89007fe390e8b19b2b59514e3.tar.gz
poezio-e78ed92ba36829b89007fe390e8b19b2b59514e3.tar.bz2
poezio-e78ed92ba36829b89007fe390e8b19b2b59514e3.tar.xz
poezio-e78ed92ba36829b89007fe390e8b19b2b59514e3.zip
Fix #2714 (make bare /bookmark use the current room password if there is one)
Diffstat (limited to 'src/core')
-rw-r--r--src/core/commands.py6
-rw-r--r--src/core/core.py4
-rw-r--r--src/core/handlers.py2
3 files changed, 8 insertions, 4 deletions
diff --git a/src/core/commands.py b/src/core/commands.py
index 338590f1..e0e426b2 100644
--- a/src/core/commands.py
+++ b/src/core/commands.py
@@ -388,13 +388,15 @@ def command_join(self, args, histo_length=None):
seconds = int(seconds)
else:
seconds = 0
+ if password:
+ tab.password = password
muc.join_groupchat(self, room, nick, password,
histo_length,
current_status.message,
current_status.show,
seconds=seconds)
if not tab:
- self.open_new_room(room, nick)
+ self.open_new_room(room, nick, password=password)
muc.join_groupchat(self, room, nick, password,
histo_length,
current_status.message,
@@ -448,6 +450,8 @@ def _add_bookmark(self, jid, autojoin, password, method):
roomname = tab.name
if tab.joined and tab.own_nick != self.own_nick:
nick = tab.own_nick
+ if password is None and tab.password is not None:
+ password = tab.password
elif jid == '*':
return _add_wildcard_bookmarks(self, method)
else:
diff --git a/src/core/core.py b/src/core/core.py
index dc4439fd..e5a6a970 100644
--- a/src/core/core.py
+++ b/src/core/core.py
@@ -1242,11 +1242,11 @@ class Core(object):
tab.privates.append(new_tab)
return new_tab
- def open_new_room(self, room, nick, focus=True):
+ def open_new_room(self, room, nick, *, password=None, focus=True):
"""
Open a new tab.MucTab containing a muc Room, using the specified nick
"""
- new_tab = tabs.MucTab(room, nick)
+ new_tab = tabs.MucTab(room, nick, password=password)
self.add_tab(new_tab, focus)
self.refresh_window()
diff --git a/src/core/handlers.py b/src/core/handlers.py
index c7b91bfb..d6bb15c1 100644
--- a/src/core/handlers.py
+++ b/src/core/handlers.py
@@ -54,7 +54,7 @@ def _join_initial_rooms(self, bookmarks):
tab = self.get_tab_by_name(bm.jid, tabs.MucTab)
nick = bm.nick if bm.nick else self.own_nick
if not tab:
- self.open_new_room(bm.jid, nick, False)
+ self.open_new_room(bm.jid, nick, focus=False)
self.initial_joins.append(bm.jid)
histo_length = config.get('muc_history_length')
if histo_length == -1: