From 2a980838a9ccc576fe1699f047e00b783ccf7e7b Mon Sep 17 00:00:00 2001 From: mathieui Date: Thu, 20 Dec 2012 18:50:34 +0100 Subject: Fix #2186 (muc password in the config file) Also use the passwords on start, and automatically use a password with /join if there is one. --- src/bookmark.py | 5 ++++- src/core.py | 12 +++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/bookmark.py b/src/bookmark.py index 8d84022d..c9659cd2 100644 --- a/src/bookmark.py +++ b/src/bookmark.py @@ -73,6 +73,8 @@ class Bookmark(object): if self.nick: local += '/%s' % self.nick local += ':' + if self.password: + config.set_and_save('password', self.password, section=self.jid) return local def parse_from_element(el, method=None): @@ -211,6 +213,7 @@ def get_local(): nick = jid.resource else: nick = None - b = Bookmark(jid.bare, autojoin=True, nick=nick, method='local') + passwd = config.get_by_tabname('password', '', jid.bare, fallback=False) or None + b = Bookmark(jid.bare, autojoin=True, nick=nick, password=passwd, method='local') if not get_by_jid(b.jid): bookmarks.append(b) diff --git a/src/core.py b/src/core.py index b0d8d832..93a52758 100644 --- a/src/core.py +++ b/src/core.py @@ -165,7 +165,7 @@ class Core(object): 'move_tab': (self.command_move_tab, _("Usage: /move_tab \nMove Tab: Insert the tab at the position of . This will make the following tabs shift in some cases (refer to the documentation). A tab can be designated by its number or by the beginning of its address."), self.completion_move_tab), 'show': (self.command_status, _('Usage: /show [status message]\nShow: Sets your availability and (optionally) your status message. The argument is one of \"available, chat, away, afk, dnd, busy, xa\" and the optional [status message] argument will be your status message.'), self.completion_status), 'status': (self.command_status, _('Usage: /status [status message]\nStatus: Sets your availability and (optionally) your status message. The argument is one of \"available, chat, away, afk, dnd, busy, xa\" and the optional [status message] argument will be your status message.'), self.completion_status), - 'bookmark_local': (self.command_bookmark_local, _("Usage: /bookmark_local [roomname][/nick]\nBookmark Local: Bookmark locally the specified room (you will then auto-join it on each poezio start). This commands uses almost the same syntaxe as /join. Type /help join for syntaxe examples. Note that when typing \"/bookmark\" on its own, the room will be bookmarked with the nickname you\'re currently using in this room (instead of default_nick)"), self.completion_bookmark_local), + 'bookmark_local': (self.command_bookmark_local, _("Usage: /bookmark_local [roomname][/nick] [password]\nBookmark Local: Bookmark locally the specified room (you will then auto-join it on each poezio start). This commands uses almost the same syntaxe as /join. Type /help join for syntaxe examples. Note that when typing \"/bookmark\" on its own, the room will be bookmarked with the nickname you\'re currently using in this room (instead of default_nick)"), self.completion_bookmark_local), 'bookmark': (self.command_bookmark, _("Usage: /bookmark [roomname][/nick] [autojoin] [password]\nBookmark: Bookmark online the specified room (you will then auto-join it on each poezio start if autojoin is specified and is 'true'). This commands uses almost the same syntaxe as /join. Type /help join for syntaxe examples. Note that when typing \"/bookmark\" on its own, the room will be bookmarked with the nickname you\'re currently using in this room (instead of default_nick)"), self.completion_bookmark), 'set': (self.command_set, _("Usage: /set [plugin|][section]