reconnect to all gc when connection comes back

This commit is contained in:
Yann Leboulanger 2005-11-13 17:24:08 +00:00
parent 082fc7aaa9
commit cdde62ac88
3 changed files with 16 additions and 0 deletions

View File

@ -69,6 +69,7 @@ encrypted_chats = {} # list of encrypted chats {acct1: [jid1, jid2], ..}
contacts = {} # list of contacts {acct: {jid1: [C1, C2]}, } one Contact per resource contacts = {} # list of contacts {acct: {jid1: [C1, C2]}, } one Contact per resource
gc_contacts = {} # list of contacts that are in gc {acct: {room_jid: {nick: C}}} gc_contacts = {} # list of contacts that are in gc {acct: {room_jid: {nick: C}}}
gc_connected = {} # tell if we are connected to the room or not {room_jid: True} gc_connected = {} # tell if we are connected to the room or not {room_jid: True}
gc_passwords = {} # list of the pass required to enter a room {room_jid: password}
groups = {} # list of groups groups = {} # list of groups
newly_added = {} # list of contacts that has just signed in newly_added = {} # list of contacts that has just signed in

View File

@ -775,6 +775,19 @@ class Interface:
if bm['autojoin'] in ('1', 'true'): if bm['autojoin'] in ('1', 'true'):
self.roster.join_gc_room(account, bm['jid'], bm['nick'], self.roster.join_gc_room(account, bm['jid'], bm['nick'],
bm['password']) bm['password'])
for account in gajim.connections:
for room_jid in self.instances[account]['gc']:
if room_jid == 'tabbed':
continue
if not gajim.gc_connected[account][room_jid]:
room, server = gajim.get_room_name_and_server_from_room_jid(
room_jid)
nick = self.instances[account]['gc'][room_jid].nicks[room_jid]
password = ''
if gajim.gc_passwords.has_key(room_jid):
password = gajim.gc_passwords[room_jid]
gajim.connections[account].join_gc(nick, room, server, password)
self.roster.make_menu() self.roster.make_menu()
def handle_event_file_send_error(self, account, array): def handle_event_file_send_error(self, account, array):

View File

@ -294,6 +294,8 @@ class RosterWindow:
gajim.interface.instances[account]['gc'][room_jid].set_active_tab(room_jid) gajim.interface.instances[account]['gc'][room_jid].set_active_tab(room_jid)
gajim.interface.instances[account]['gc'][room_jid].window.present() gajim.interface.instances[account]['gc'][room_jid].window.present()
gajim.connections[account].join_gc(nick, room, server, password) gajim.connections[account].join_gc(nick, room, server, password)
if password:
gajim.gc_passwords[room_jid] = password
def on_bookmark_menuitem_activate(self, widget, account, bookmark): def on_bookmark_menuitem_activate(self, widget, account, bookmark):
self.join_gc_room(account, bookmark['jid'], bookmark['nick'], self.join_gc_room(account, bookmark['jid'], bookmark['nick'],