Changeset 9846 for trunk/src/gajim.py
- Timestamp:
- 06/27/08 01:36:58 (5 months ago)
- Files:
-
- 1 modified
-
trunk/src/gajim.py (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gajim.py
r9845 r9846 539 539 return 540 540 541 for ctrl in self.msg_win_mgr.get_chat_controls(jid_from, account):542 ifctrl.type_id == message_control.TYPE_GC:543 ctrl.print_conversation('Error %s: %s' % (array[2], array[1]))541 ctrl = self.msg_win_mgr.get_control(jid_from, account) 542 if ctrl and ctrl.type_id == message_control.TYPE_GC: 543 ctrl.print_conversation('Error %s: %s' % (array[2], array[1])) 544 544 545 545 def handle_event_con_type(self, account, con_type): … … 662 662 # don't have to open a new tab if a new session comes in 663 663 664 for ctrl in self.msg_win_mgr.get_chat_controls(jid, account): 664 ctrl = self.msg_win_mgr.get_control(jid, account) 665 if ctrl: 665 666 ctrl.set_session(None) 666 667 … … 813 814 nick = jids[1] 814 815 815 ctrl = None816 816 if session: 817 817 ctrl = session.control 818 819 if not ctrl: 820 ctrls = self.msg_win_mgr.get_chat_controls(full_jid_with_resource, account) 821 if ctrls: 822 ctrl = ctrls[0] 818 else: 819 ctrl = self.msg_win_mgr.get_control(full_jid_with_resource, account) 823 820 824 821 if not ctrl: … … 1125 1122 self.roster.draw_contact(room_jid, account) 1126 1123 1127 # print status in chat windows and update status/GPG image 1128 for ctrl in self.msg_win_mgr.get_chat_controls(fjid, account): 1124 # print status in chat window and update status/GPG image 1125 ctrl = self.msg_win_mgr.get_control(fjid, account) 1126 if ctrl: 1129 1127 statusCode = array[9] 1130 1128 if '303' in statusCode: … … 1818 1816 1819 1817 def handle_event_ping_sent(self, account, contact): 1820 for ctrl in self.msg_win_mgr.get_chat_controls(contact.jid, account):1821 ctrl .print_conversation(_('Ping?'), 'status')1822 for ctrl in self.msg_win_mgr.get_chat_controls(contact.get_full_jid(), account):1823 ctrl.print_conversation(_('Ping?'), 'status')1818 for jid in [contact.jid, contact.get_full_jid()]: 1819 ctrl = self.msg_win_mgr.get_control(jid, account) 1820 if ctrl: 1821 ctrl.print_conversation(_('Ping?'), 'status') 1824 1822 1825 1823 def handle_event_ping_reply(self, account, data): 1826 1824 contact = data[0] 1827 1825 seconds = data[1] 1828 for ctrl in self.msg_win_mgr.get_chat_controls(contact.jid, account): 1829 ctrl.print_conversation(_('Pong! (%s s.)') % seconds, 'status') 1830 for ctrl in self.msg_win_mgr.get_chat_controls(contact.get_full_jid(), account): 1831 ctrl.print_conversation(_('Pong! (%s s.)') % seconds, 'status') 1826 1827 for jid in [contact.jid, contact.get_full_jid()]: 1828 ctrl = self.msg_win_mgr.get_control(jid, account) 1829 if ctrl: 1830 ctrl.print_conversation(_('Pong! (%s s.)') % seconds, 'status') 1832 1831 1833 1832 def handle_event_ping_error(self, account, contact): 1834 for ctrl in self.msg_win_mgr.get_chat_controls(contact.jid, account):1835 ctrl .print_conversation(_('Error.'), 'status')1836 for ctrl in self.msg_win_mgr.get_chat_controls(contact.get_full_jid(), account):1837 ctrl.print_conversation(_('Error.'), 'status')1833 for jid in [contact.jid, contact.get_full_jid()]: 1834 ctrl = self.msg_win_mgr.get_control(jid, account) 1835 if ctrl: 1836 ctrl.print_conversation(_('Error.'), 'status') 1838 1837 1839 1838 def handle_event_search_form(self, account, data): … … 2127 2126 ctrl = session.control 2128 2127 elif type_ == '': 2129 ctrls = self.msg_win_mgr.get_chat_controls(fjid, account) 2130 2131 if ctrls: 2132 ctrl = ctrls[0] 2128 ctrl = self.msg_win_mgr.get_control(fjid, account) 2133 2129 2134 2130 if not ctrl: … … 2579 2575 resource=resource) 2580 2576 2581 ctrls = self.msg_win_mgr.get_chat_controls(fjid, account) 2582 if ctrls: 2583 ctrl = ctrls[0] 2584 else: 2577 ctrl = self.msg_win_mgr.get_control(fjid, account) 2578 2579 if not ctrl: 2585 2580 ctrl = self.new_chat(contact, account, 2586 2581 resource=resource)
