summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2014-10-12 23:06:44 +0200
committermathieui <mathieui@mathieui.net>2014-10-12 23:06:44 +0200
commit5a5d5812edeb852232ea22f8b10e6d2073ca05d1 (patch)
tree287f1828f4efa83ffc66ac09da823fb6c34ae23d
parent6c62f624024e954217b7217a691469484ffb70d2 (diff)
downloadpoezio-5a5d5812edeb852232ea22f8b10e6d2073ca05d1.tar.gz
poezio-5a5d5812edeb852232ea22f8b10e6d2073ca05d1.tar.bz2
poezio-5a5d5812edeb852232ea22f8b10e6d2073ca05d1.tar.xz
poezio-5a5d5812edeb852232ea22f8b10e6d2073ca05d1.zip
Add an open_all_bookmarks option
this option determines if the non-autojoin bookmarks will be opened on startup or not. It is false by default.
-rw-r--r--data/default_config.cfg5
-rw-r--r--doc/source/configuration.rst7
-rw-r--r--src/core/handlers.py37
3 files changed, 30 insertions, 19 deletions
diff --git a/data/default_config.cfg b/data/default_config.cfg
index ed21eab0..c1f766b0 100644
--- a/data/default_config.cfg
+++ b/data/default_config.cfg
@@ -116,9 +116,12 @@ use_bookmarks_method =
# use this option to force the use of local bookmarks
# possible values are: anything/false
-
use_remote_bookmarks = true
+# Whether you want all bookmarks, even those without
+# autojoin, to be open on startup
+open_all_bookmarks = false
+
# What will be put after the name, when using autocompletion at the
# beginning of the input. A space will always be added after that
after_completion = ,
diff --git a/doc/source/configuration.rst b/doc/source/configuration.rst
index 419e1880..32d82f7a 100644
--- a/doc/source/configuration.rst
+++ b/doc/source/configuration.rst
@@ -197,6 +197,13 @@ Options related to account configuration, nicknameā€¦
The status message poezio will send when connecting.
+ open_all_bookmarks
+
+ **Default value:** ``false``
+
+ If this option is set to ``true``, all remote bookmarks, even
+ those that do not have autojoin, will be opened on startup.
+ (the tabs without autojoin will not be joined)
diff --git a/src/core/handlers.py b/src/core/handlers.py
index 96a0f7e8..ea67eaa6 100644
--- a/src/core/handlers.py
+++ b/src/core/handlers.py
@@ -869,24 +869,25 @@ def on_session_start(self, event):
if not self.xmpp.anon and config.get('use_remote_bookmarks', True):
bookmark.get_remote(self.xmpp)
for bm in bookmark.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.initial_joins.append(bm.jid)
- histo_length = config.get('muc_history_length', 20)
- if histo_length == -1:
- histo_length = None
- if histo_length is not None:
- histo_length = str(histo_length)
- # do not join rooms that do not have autojoin
- # but display them anyway
- if bm.autojoin:
- muc.join_groupchat(self, bm.jid, nick,
- passwd=bm.password,
- maxhistory=histo_length,
- status=self.status.message,
- show=self.status.show)
+ if bm.autojoin or config.get('open_all_bookmarks', False):
+ 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.initial_joins.append(bm.jid)
+ histo_length = config.get('muc_history_length', 20)
+ if histo_length == -1:
+ histo_length = None
+ if histo_length is not None:
+ histo_length = str(histo_length)
+ # do not join rooms that do not have autojoin
+ # but display them anyway
+ if bm.autojoin:
+ muc.join_groupchat(self, bm.jid, nick,
+ passwd=bm.password,
+ maxhistory=histo_length,
+ status=self.status.message,
+ show=self.status.show)
if config.get('enable_user_nick', True):
self.xmpp.plugin['xep_0172'].publish_nick(nick=self.own_nick, callback=dumb_callback, block=False)