Skip to content
Snippets Groups Projects
Commit dbcfc984 authored by Brendan Taylor's avatar Brendan Taylor
Browse files

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

fixes #3961
parent df5200b3
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment