fix handle_event() for pms and new_chat_from_jid() for existing chat controls
This commit is contained in:
parent
b1f13ca040
commit
7721abb2b1
22
src/gajim.py
22
src/gajim.py
|
@ -2312,13 +2312,13 @@ class Interface:
|
||||||
event = gajim.events.get_first_event(account, jid, type_)
|
event = gajim.events.get_first_event(account, jid, type_)
|
||||||
|
|
||||||
if type_ == 'printed_pm':
|
if type_ == 'printed_pm':
|
||||||
session = event.parameters[0]
|
ctrl = event.parameters[0]
|
||||||
elif type_ == 'pm':
|
elif type_ == 'pm':
|
||||||
session = event.parameters[8]
|
session = event.parameters[8]
|
||||||
|
|
||||||
if session and session.control:
|
if session and session.control:
|
||||||
ctrl = session.control
|
ctrl = session.control
|
||||||
else:
|
elif not ctrl:
|
||||||
room_jid = jid
|
room_jid = jid
|
||||||
nick = resource
|
nick = resource
|
||||||
gc_contact = gajim.contacts.get_gc_contact(account, room_jid,
|
gc_contact = gajim.contacts.get_gc_contact(account, room_jid,
|
||||||
|
@ -2723,19 +2723,19 @@ class Interface:
|
||||||
contact = self.roster.add_to_not_in_the_roster(account, jid,
|
contact = self.roster.add_to_not_in_the_roster(account, jid,
|
||||||
resource=resource)
|
resource=resource)
|
||||||
|
|
||||||
session = gajim.connections[account].get_or_create_session(fjid, None)
|
if self.msg_win_mgr.has_window(fjid, account):
|
||||||
|
ctrl = self.msg_win_mgr.get_chat_controls(fjid, account)[0]
|
||||||
if not self.msg_win_mgr.has_window(fjid, account):
|
else:
|
||||||
session.control = self.new_chat(contact, account,
|
ctrl = self.new_chat(contact, account,
|
||||||
resource=resource, session=session)
|
resource=resource)
|
||||||
if len(gajim.events.get_events(account, fjid)):
|
if len(gajim.events.get_events(account, fjid)):
|
||||||
session.control.read_queue()
|
ctrl.read_queue()
|
||||||
|
|
||||||
mw = session.control.parent_win
|
mw = ctrl.parent_win
|
||||||
mw.set_active_tab(session.control)
|
mw.set_active_tab(ctrl)
|
||||||
# For JEP-0172
|
# For JEP-0172
|
||||||
if added_to_roster:
|
if added_to_roster:
|
||||||
session.control.user_nick = gajim.nicks[account]
|
ctrl.user_nick = gajim.nicks[account]
|
||||||
|
|
||||||
def on_open_chat_window(self, widget, contact, account, resource=None,
|
def on_open_chat_window(self, widget, contact, account, resource=None,
|
||||||
session=None):
|
session=None):
|
||||||
|
|
Loading…
Reference in New Issue