Do not add a nick to each bookmarked room

This commit is contained in:
mathieui 2013-05-10 14:55:50 +02:00
parent 6767d04a1d
commit 686352d22b
2 changed files with 4 additions and 7 deletions

View file

@ -28,9 +28,6 @@ class Bookmark(object):
self.jid = jid
self.name = name or jid
self.autojoin = autojoin
if not nick:
default = os.environ.get('USER') if os.environ.get('USER') else 'poezio'
nick = config.get('default_nick', '') or default
self.nick = nick
self.password = password
self._method = method

View file

@ -146,7 +146,7 @@ class Core(object):
self._current_tab_nb = 0
self.previous_tab_nb = 0
self.own_nick = config.get('default_nick', '') or self.xmpp.boundjid.user
self.own_nick = config.get('default_nick', '') or self.xmpp.boundjid.user or os.environ.get('USER') or 'poezio'
self.plugins_autoloaded = False
self.plugin_manager = PluginManager(self)
@ -1810,7 +1810,7 @@ class Core(object):
if len(args) == 0:
tab = self.current_tab()
roomname = tab.get_name()
if tab.joined:
if tab.joined and tab.own_nick != self.own_nick:
nick = tab.own_nick
elif args[0] == '*':
for tab in self.tabs:
@ -3267,9 +3267,9 @@ class Core(object):
bookmark.get_remote(self.xmpp)
for bm in bookmark.bookmarks:
tab = self.get_tab_by_name(bm.jid, tabs.MucTab)
if not tab:
self.open_new_room(bm.jid, bm.nick, False)
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: