Author: bct Date: 2008-05-25 23:28:40 +0200 (Sun, 25 May 2008) New Revision: 9697
Modified: trunk/src/session.py Log: don't do first message notification if we can pick up a sessionless control fixes #3961
Modified: trunk/src/session.py =================================================================== --- trunk/src/session.py 2008-05-25 21:28:32 UTC (rev 9696) +++ trunk/src/session.py 2008-05-25 21:28:40 UTC (rev 9697) @@ -180,6 +180,20 @@ jid_of_control, [msg_type]): first = True
+ if not self.control: + # look for an existing chat control without a session + mw = gajim.interface.msg_win_mgr.get_window(jid, self.conn.name) + + if mw: + ctrls = mw.sessionless_controls(self.conn.name, jid) + + if len(ctrls): + ctrl = ctrls[0] + self.control = ctrl + ctrl.set_session(self) + ctrl.parent_win.move_from_sessionless(ctrl) + first = False + if pm: nickname = resource groupchat_control.on_private_message(nickname, msgtxt, tim, @@ -256,19 +270,6 @@ self.conn.name, jid, user_nick)
if not self.control: - # look for an existing chat control without a session - mw = gajim.interface.msg_win_mgr.get_window(jid, self.conn.name) - - if mw: - ctrls = mw.sessionless_controls(self.conn.name, jid) - - if len(ctrls): - ctrl = ctrls[0] - self.control = ctrl - ctrl.set_session(self) - ctrl.parent_win.move_from_sessionless(ctrl) - - if not self.control: # if no control exists and message comes from highest prio, the new # control shouldn't have a resource if highest_contact and contact.resource == highest_contact.resource \