Changeset 9961

Show
Ignore:
Timestamp:
07/19/08 20:31:45 (5 months ago)
Author:
bct
Message:

update status in resource-specific chat windows

Location:
trunk/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/chat_control.py

    r9953 r9961  
    23812381                        self.contact = contact 
    23822382                self.draw_banner() 
     2383 
     2384        def update_status_display(self, name, uf_show, status): 
     2385                '''print the contact's status and update the status/GPG image''' 
     2386                self.update_ui() 
     2387                self.parent_win.redraw_tab(self) 
     2388 
     2389                self.print_conversation(_('%s is now %s') % (name, uf_show), 
     2390                        'status') 
     2391 
     2392                if status: 
     2393                        ctrl.print_conversation(' (', 'status', simple=True) 
     2394                        ctrl.print_conversation('%s' % (status), 'status', simple=True) 
     2395                        ctrl.print_conversation(')', 'status', simple=True) 
  • trunk/src/roster_window.py

    r9960 r9961  
    18041804                # name is to show in conversation window 
    18051805                name = contact.get_shown_name() 
    1806                  
     1806 
    18071807                # The contact has several resources 
    18081808                if len(contact_instances) > 1: 
     
    18291829                        self.remove_contact(contact.jid, account, backend=True) 
    18301830 
     1831                uf_show = helpers.get_uf_show(show) 
     1832 
    18311833                # print status in chat window and update status/GPG image 
    1832                 if gajim.interface.msg_win_mgr.has_window(contact.jid, account): 
    1833                         win = gajim.interface.msg_win_mgr.get_window(contact.jid, account) 
    1834                         uf_show = helpers.get_uf_show(show) 
    1835  
    1836                         ctrl = win.get_control(contact.jid, account) 
     1834                ctrl = gajim.interface.msg_win_mgr.get_control(contact.jid, account) 
     1835                if ctrl: 
     1836                        ctrl.contact = gajim.contacts.get_contact_with_highest_priority( 
     1837                                account, contact.jid) 
     1838                        ctrl.update_status_display(name, uf_show, status) 
     1839 
     1840                if contact.resource != '': 
     1841                        fjid = contact.jid + '/' + contact.resource 
     1842 
     1843                        ctrl = gajim.interface.msg_win_mgr.get_control(fjid, account) 
    18371844                        if ctrl: 
    1838                                 ctrl.contact = gajim.contacts.get_contact_with_highest_priority( 
    1839                                         account, contact.jid) 
    1840                                 ctrl.update_ui() 
    1841                                 win.redraw_tab(ctrl) 
    1842  
    1843                                 ctrl.print_conversation(_('%s is now %s') % (name, uf_show), 
    1844                                         'status') 
    1845                                 if status: 
    1846                                         ctrl.print_conversation(' (', 'status', simple=True) 
    1847                                         ctrl.print_conversation('%s' % (status), 'status', simple=True) 
    1848                                         ctrl.print_conversation(')', 'status', simple=True) 
     1845                                ctrl.update_status_display(name, uf_show, status) 
    18491846 
    18501847                # unset custom status