summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2011-11-26 23:27:42 +0100
committermathieui <mathieui@mathieui.net>2011-11-26 23:27:42 +0100
commitd2726c8892281a310b122143b80e8edd3be805b0 (patch)
tree39219bcdf0145da26a537f3b875dd424ce88e9e2 /src
parent4ce8721c3d190d9193f31badbd16e772eafbb9c5 (diff)
downloadpoezio-d2726c8892281a310b122143b80e8edd3be805b0.tar.gz
poezio-d2726c8892281a310b122143b80e8edd3be805b0.tar.bz2
poezio-d2726c8892281a310b122143b80e8edd3be805b0.tar.xz
poezio-d2726c8892281a310b122143b80e8edd3be805b0.zip
Adapt the startup to the new bookmarks system
Diffstat (limited to 'src')
-rw-r--r--src/core.py25
1 files changed, 9 insertions, 16 deletions
diff --git a/src/core.py b/src/core.py
index b3b13fe4..0780b6f2 100644
--- a/src/core.py
+++ b/src/core.py
@@ -39,6 +39,7 @@ import pubsub
import windows
import connection
import timed_events
+import bookmark
from plugin_manager import PluginManager
@@ -569,23 +570,15 @@ class Core(object):
pres = self.xmpp.make_presence()
self.events.trigger('send_normal_presence', pres)
pres.send()
- rooms = config.get('rooms', '')
- if rooms == '' or not isinstance(rooms, str):
- return
- rooms = rooms.split(':')
- for room in rooms:
- jid = JID(room)
- if jid.bare == '':
- return
- if jid.resource != '':
- nick = jid.resource
- else:
- default = os.environ.get('USER') if os.environ.get('USER') else 'poezio'
- nick = config.get('default_nick', '') or default
- tab = self.get_tab_by_name(jid.bare, tabs.MucTab)
+ bookmark.get_local()
+ if not self.xmpp.anon:
+ bookmark.get_remote(self.xmpp)
+ for bm in [item for item in bookmark.bookmarks if item.autojoin]:
+ tab = self.get_tab_by_name(bm.jid, tabs.MucTab)
if not tab:
- self.open_new_room(jid.bare, nick, False)
- muc.join_groupchat(self.xmpp, jid.bare, nick)
+ self.open_new_room(bm.jid, bm.nick, False)
+ nick = bm.nick if bm.nick else self.own_nick
+ muc.join_groupchat(self.xmpp, bm.jid, nick)
def on_groupchat_presence(self, presence):
"""