don't do first message notification if we can pick up a sessionless control

fixes #3961
This commit is contained in:
Brendan Taylor 2008-05-25 21:28:40 +00:00
parent df5200b3bb
commit dbcfc984f5
1 changed files with 14 additions and 13 deletions

View File

@ -180,6 +180,20 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession):
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,
@ -255,19 +269,6 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession):
contact = gajim.interface.roster.add_to_not_in_the_roster(
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