Show
Ignore:
Timestamp:
06/27/08 01:36:58 (5 months ago)
Author:
bct
Message:

first pass at stripping out the one-tab-per-session code

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/common/helpers.py

    r9815 r9846  
    959959        highest_contact = gajim.contacts.get_contact_with_highest_priority( 
    960960                account, contact.jid) 
     961 
    961962        # Look for a chat control that has the given resource, or default to 
    962963        # one without resource 
    963         ctrls = gajim.interface.msg_win_mgr.get_chat_controls(full_jid_with_resource, 
     964        ctrl = gajim.interface.msg_win_mgr.get_control(full_jid_with_resource, 
    964965                account) 
    965         if ctrls: 
    966                 return ctrls[0] 
    967         elif not highest_contact or not highest_contact.resource: 
    968                 # unknow contact or offline message 
    969                 pass # fall through, handle this at the end 
    970         elif highest_contact and contact.resource != \ 
    971         highest_contact.resource: 
     966 
     967        if ctrl: 
     968                return ctrl 
     969        elif highest_contact and highest_contact.resource and \ 
     970        contact.resource != highest_contact.resource: 
    972971                return None 
    973  
    974         ctrls = gajim.interface.msg_win_mgr.get_chat_controls(contact.jid, account) 
    975         if ctrls: 
    976                 return ctrls[0] 
    977         else: 
    978                 return None 
     972        else: 
     973                # unknown contact or offline message 
     974                return gajim.interface.msg_win_mgr.get_control(contact.jid, account) 
    979975 
    980976def reduce_chars_newlines(text, max_chars = 0, max_lines = 0):