Changeset 9960 for trunk/src/roster_window.py
- Timestamp:
- 07/19/08 19:36:21 (5 months ago)
- Files:
-
- 1 modified
-
trunk/src/roster_window.py (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/roster_window.py
r9945 r9960 706 706 self._remove_entity(contact, account) 707 707 708 709 708 if backend: 710 709 # Remove contact before redrawing, otherwise the old … … 731 730 ''' 732 731 contact = gajim.contacts.get_contact_with_highest_priority(account, jid) 732 # Do not show gc if we are disconnected and minimize it 733 if gajim.account_is_connected(account): 734 show = 'online' 735 else: 736 show = 'offline' 737 status = '' 738 733 739 if contact is None: 734 # Do not show gc if we are disconnected and minimize it 735 if gajim.account_is_connected(account): 736 show = 'online' 737 else: 738 show = 'offline' 739 status = '' 740 # New groupchat 740 741 contact = gajim.contacts.create_contact(jid=jid, name=jid, 741 742 groups=[_('Groupchats')], show=show, status=status, sub='none') 742 743 gajim.contacts.add_contact(account, contact) 744 gc_control = gajim.interface.msg_win_mgr.get_gc_control(jid, account) 745 if gc_control: 746 # there is a window that we can minimize 747 gajim.interface.minimized_controls[account][jid] = gc_control 743 748 self.add_contact(jid, account) 744 749 else: 745 contact.show = 'online' 750 contact.show = show 751 contact.status = status 746 752 self.draw_completely_and_show_if_needed(jid, account) 753 747 754 return contact 748 755 … … 752 759 contact = gajim.contacts.get_contact_with_highest_priority(account, jid) 753 760 if contact.is_groupchat(): 761 if jid in gajim.interface.minimized_controls[account]: 762 gajim.interface.minimized_controls[account][jid] 754 763 self.remove_contact(jid, account, force=True, backend=True) 755 764 return True … … 962 971 963 972 # gets number of unread gc marked messages 964 if jid in gajim.interface.minimized_controls[account]: 973 if jid in gajim.interface.minimized_controls[account] and \ 974 gajim.interface.minimized_controls[account][jid]: 965 975 nb_unread = len(gajim.events.get_events(account, jid, 966 976 ['printed_marked_gc_msg'])) … … 1582 1592 return False 1583 1593 1584 def auto_join_bookmarks(self, account):1585 '''autojoin bookmarks that have 'auto join' on for this account'''1586 for bm in gajim.connections[account].bookmarks:1587 if bm['autojoin'] in ('1', 'true'):1588 jid = bm['jid']1589 if not gajim.gc_connected[account].has_key(jid) or\1590 not gajim.gc_connected[account][jid]:1591 # we are not already connected1592 minimize = bm['minimize'] in ('1', 'true')1593 gajim.interface.join_gc_room(account, jid, bm['nick'],1594 bm['password'], minimize = minimize)1595 1596 1594 def on_event_removed(self, event_list): 1597 1595 '''Remove contacts on last events removed. … … 2652 2650 def on_disconnect(self, widget, jid, account): 2653 2651 '''When disconnect menuitem is activated: disconect from room''' 2654 ctrl = gajim.interface.minimized_controls[account][jid]2655 delgajim.interface.minimized_controls[account][jid]2656 ctrl.shutdown()2652 if jid in gajim.interface.minimized_controls[account]: 2653 ctrl = gajim.interface.minimized_controls[account][jid] 2654 ctrl.shutdown() 2657 2655 self.remove_groupchat(jid, account) 2658 2656 … … 2723 2721 def on_groupchat_maximized(self, widget, jid, account): 2724 2722 '''When a groupchat is maximised''' 2723 if not jid in gajim.interface.minimized_controls[account]: 2724 return 2725 2725 ctrl = gajim.interface.minimized_controls[account][jid] 2726 2726 mw = gajim.interface.msg_win_mgr.get_window(ctrl.contact.jid, … … 2732 2732 mw.new_tab(ctrl) 2733 2733 mw.set_active_tab(ctrl) 2734 del gajim.interface.minimized_controls[account][jid] 2735 2734 2736 2735 self.remove_groupchat(jid, account) 2737 2736 … … 3241 3240 jid = model[path][C_JID].decode('utf-8') 3242 3241 resource = None 3243 contact = None3242 contact = gajim.contacts.get_first_contact_from_jid(account, jid) 3244 3243 titer = model.get_iter(path) 3245 3244 if type_ in ('group', 'account'): … … 3248 3247 else: 3249 3248 self.tree.expand_row(path, False) 3250 elif jid in gajim.interface.minimized_controls[account]: 3251 self.on_groupchat_maximized(None, jid, account) 3249 elif contact.is_groupchat(): 3250 first_ev = gajim.events.get_first_event(account, jid) 3251 if first_ev and self.open_event(account, jid, first_ev): 3252 # We are invited to a GC 3253 # open event cares about connecting to it 3254 self.remove_groupchat(jid, account) 3255 else: 3256 self.on_groupchat_maximized(None, jid, account) 3252 3257 else: 3253 3258 first_ev = gajim.events.get_first_event(account, jid)
