Changeset 9820

Show
Ignore:
Timestamp:
06/18/08 06:11:11 (6 months ago)
Author:
bct
Message:

fix handle_event() for pms and new_chat_from_jid() for existing chat controls

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/gajim.py

    r9819 r9820  
    23132313 
    23142314                        if type_ == 'printed_pm': 
    2315                                 session = event.parameters[0] 
     2315                                ctrl = event.parameters[0] 
    23162316                        elif type_ == 'pm': 
    23172317                                session = event.parameters[8] 
     
    23192319                        if session and session.control: 
    23202320                                ctrl = session.control 
    2321                         else: 
     2321                        elif not ctrl: 
    23222322                                room_jid = jid 
    23232323                                nick = resource 
     
    27242724                                resource=resource) 
    27252725 
    2726                 session = gajim.connections[account].get_or_create_session(fjid, None) 
    2727  
    2728                 if not self.msg_win_mgr.has_window(fjid, account): 
    2729                         session.control = self.new_chat(contact, account, 
    2730                                 resource=resource, session=session) 
     2726                if self.msg_win_mgr.has_window(fjid, account): 
     2727                        ctrl = self.msg_win_mgr.get_chat_controls(fjid, account)[0] 
     2728                else: 
     2729                        ctrl = self.new_chat(contact, account, 
     2730                                resource=resource) 
    27312731                        if len(gajim.events.get_events(account, fjid)): 
    2732                                 session.control.read_queue() 
    2733  
    2734                 mw = session.control.parent_win 
    2735                 mw.set_active_tab(session.control) 
     2732                                ctrl.read_queue() 
     2733 
     2734                mw = ctrl.parent_win 
     2735                mw.set_active_tab(ctrl) 
    27362736                # For JEP-0172 
    27372737                if added_to_roster: 
    2738                         session.control.user_nick = gajim.nicks[account] 
     2738                        ctrl.user_nick = gajim.nicks[account] 
    27392739 
    27402740        def on_open_chat_window(self, widget, contact, account, resource=None,