gave sessionless window location its own method
This commit is contained in:
parent
45fe866240
commit
bcf7018fce
|
@ -934,6 +934,17 @@ class MessageWindowMgr(gobject.GObject):
|
|||
|
||||
return None
|
||||
|
||||
def get_sessionless_ctrl(self, acct, jid):
|
||||
'''returns a ChatControl associated with jid, that doesn't have a
|
||||
session attached'''
|
||||
mw = self.get_window(jid, acct)
|
||||
|
||||
if mw:
|
||||
ctrls = mw.sessionless_controls(acct, jid)
|
||||
|
||||
if len(ctrls):
|
||||
return ctrls[0]
|
||||
|
||||
def has_window(self, jid, acct):
|
||||
return self.get_window(jid, acct) is not None
|
||||
|
||||
|
|
|
@ -182,16 +182,11 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession):
|
|||
|
||||
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]
|
||||
ctrl = gajim.interface.msg_win_mgr.get_sessionless_ctrl(jid, self.conn.name)
|
||||
if ctrl:
|
||||
self.control = ctrl
|
||||
ctrl.set_session(self)
|
||||
ctrl.parent_win.move_from_sessionless(ctrl)
|
||||
self.control.set_session(self)
|
||||
self.control.parent_win.move_from_sessionless(self.control)
|
||||
first = False
|
||||
|
||||
if pm:
|
||||
|
|
Loading…
Reference in New Issue