Changeset 9960 for trunk/src/gajim.py
- Timestamp:
- 07/19/08 19:36:21 (5 months ago)
- Files:
-
- 1 modified
-
trunk/src/gajim.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gajim.py
r9956 r9960 2129 2129 if type_ in ('printed_gc_msg', 'printed_marked_gc_msg', 'gc_msg'): 2130 2130 w = self.msg_win_mgr.get_window(jid, account) 2131 if self.minimized_controls[account].has_key(jid): 2132 if not w: 2133 ctrl = self.minimized_controls[account][jid] 2134 w = self.msg_win_mgr.create_window(ctrl.contact, \ 2135 ctrl.account, ctrl.type_id) 2131 if jid in self.minimized_controls[account]: 2136 2132 self.roster.on_groupchat_maximized(None, jid, account) 2137 2133 … … 2474 2470 2475 2471 def join_gc_room(self, account, room_jid, nick, password, minimize=False, 2476 is_continued=False):2472 is_continued=False): 2477 2473 '''joins the room immediately''' 2478 2474 if not nick: 2479 2475 nick = gajim.nicks[account] 2476 2480 2477 if self.msg_win_mgr.has_window(room_jid, account) and \ 2481 gajim.gc_connected[account][room_jid]:2478 gajim.gc_connected[account][room_jid]: 2482 2479 gc_ctrl = self.msg_win_mgr.get_gc_control(room_jid, account) 2483 2480 win = gc_ctrl.parent_win … … 2485 2482 dialogs.ErrorDialog(_('You are already in group chat %s') % room_jid) 2486 2483 return 2487 minimized_control_exists = False 2488 if room_jid in gajim.interface.minimized_controls[account]: 2489 minimized_control_exists = True 2484 2490 2485 invisible_show = gajim.SHOW_LIST.index('invisible') 2491 2486 if gajim.connections[account].connected == invisible_show: … … 2493 2488 _('You cannot join a group chat while you are invisible')) 2494 2489 return 2495 if minimize and not minimized_control_exists and \ 2490 2491 minimized_control_exists = False 2492 if room_jid in gajim.interface.minimized_controls[account]: 2493 minimized_control_exists = True 2494 2495 if not minimized_control_exists and \ 2496 2496 not self.msg_win_mgr.has_window(room_jid, account): 2497 contact = gajim.contacts.create_contact(jid=room_jid, name=nick) 2498 gc_control = GroupchatControl(None, contact, account) 2499 self.minimized_controls[account][room_jid] = gc_control 2500 gajim.connections[account].join_gc(nick, room_jid, password) 2501 if password: 2502 gajim.gc_passwords[room_jid] = password 2497 # Join new groupchat 2498 if minimize: 2499 contact = gajim.contacts.create_contact(jid=room_jid, name=nick) 2500 gc_control = GroupchatControl(None, contact, account) 2501 gajim.interface.minimized_controls[account][room_jid] = gc_control 2502 self.roster.add_groupchat(room_jid, account) 2503 else: 2504 self.new_room(room_jid, nick, account, is_continued=is_continued) 2505 elif not minimized_control_exists: 2506 # We are already in that groupchat 2507 gc_control = self.msg_win_mgr.get_gc_control(room_jid, account) 2508 gc_control.parent_win.set_active_tab(gc_control) 2509 else: 2510 # We are already in this groupchat and it is minimized 2503 2511 self.roster.add_groupchat(room_jid, account) 2504 return 2505 if not minimized_control_exists and \ 2506 not self.msg_win_mgr.has_window(room_jid, account): 2507 self.new_room(room_jid, nick, account, is_continued=is_continued) 2508 if not minimized_control_exists: 2509 gc_control = self.msg_win_mgr.get_gc_control(room_jid, account) 2510 gc_control.parent_win.set_active_tab(gc_control) 2512 2513 # Connect 2511 2514 gajim.connections[account].join_gc(nick, room_jid, password) 2512 2515 if password: 2513 2516 gajim.gc_passwords[room_jid] = password 2514 contact = gajim.contacts.get_contact_with_highest_priority(account, \2515 room_jid)2516 if contact or minimized_control_exists:2517 self.roster.add_groupchat(room_jid, account)2518 2517 2519 2518 def new_room(self, room_jid, nick, account, is_continued=False): … … 2822 2821 # Only join non-opened groupchats. Opened one are already 2823 2822 # auto-joined on re-connection 2824 if not gajim.gc_connected[account].has_key(jid):2823 if not jid in gajim.gc_connected[account]: 2825 2824 # we are not already connected 2826 2825 minimize = bm['minimize'] in ('1', 'true') 2827 2826 gajim.interface.join_gc_room(account, jid, bm['nick'], 2828 2827 bm['password'], minimize = minimize) 2828 elif jid in self.minimized_controls[account]: 2829 # more or less a hack: 2830 # On disconnect the minimized gc contact instances 2831 # were set to offline. Reconnect them to show up in the roster. 2832 self.roster.add_groupchat(jid, account) 2829 2833 2830 2834 def add_gc_bookmark(self, account, name, jid, autojoin, minimize, password,
