diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2017-11-23 17:55:54 +0000 |
---|---|---|
committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2017-11-23 17:55:54 +0000 |
commit | b705aba4e2eca82433b7143bc7bfe2f5ef2d13d4 (patch) | |
tree | ca9d78e92c54ea6a2340407b0376dedfbafdbbf7 | |
parent | 5f5cc186dc1e708b9894b02db57e3dad4ed7cb10 (diff) | |
download | poezio-b705aba4e2eca82433b7143bc7bfe2f5ef2d13d4.tar.gz poezio-b705aba4e2eca82433b7143bc7bfe2f5ef2d13d4.tar.bz2 poezio-b705aba4e2eca82433b7143bc7bfe2f5ef2d13d4.tar.xz poezio-b705aba4e2eca82433b7143bc7bfe2f5ef2d13d4.zip |
Add an autojoined bookmark on /join.
-rw-r--r-- | data/default_config.cfg | 4 | ||||
-rw-r--r-- | poezio/config.py | 1 | ||||
-rw-r--r-- | poezio/core/commands.py | 4 |
3 files changed, 9 insertions, 0 deletions
diff --git a/data/default_config.cfg b/data/default_config.cfg index 01b03e9a..583f4726 100644 --- a/data/default_config.cfg +++ b/data/default_config.cfg @@ -137,6 +137,10 @@ use_bookmarks_method = # autojoin, to be open on startup #open_all_bookmarks = false +# Will create a bookmark on manual /join, using your preferred +# storage method +#bookmark_on_join = true + # 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/poezio/config.py b/poezio/config.py index 9c06d25b..5ee4a2b4 100644 --- a/poezio/config.py +++ b/poezio/config.py @@ -33,6 +33,7 @@ DEFAULT_CONFIG = { 'autorejoin_delay': '5', 'autorejoin': False, 'beep_on': 'highlight private invite disconnect', + 'bookmark_on_join': True, 'ca_cert_path': '', 'certificate': '', 'certfile': '', diff --git a/poezio/core/commands.py b/poezio/core/commands.py index ab0ced9a..91d98030 100644 --- a/poezio/core/commands.py +++ b/poezio/core/commands.py @@ -406,6 +406,10 @@ class CommandCore: tab.password = password tab.join() + if config.get('bookmark_on_join'): + method = 'remote' if config.get('use_remote_bookmarks') else 'local' + self._add_bookmark('%s/%s' % (room, nick), True, password, method) + if tab == self.core.current_tab(): tab.refresh() self.core.doupdate() |