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
|
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):
|
def has_window(self, jid, acct):
|
||||||
return self.get_window(jid, acct) is not None
|
return self.get_window(jid, acct) is not None
|
||||||
|
|
||||||
|
|
|
@ -182,17 +182,12 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession):
|
||||||
|
|
||||||
if not self.control:
|
if not self.control:
|
||||||
# look for an existing chat control without a session
|
# look for an existing chat control without a session
|
||||||
mw = gajim.interface.msg_win_mgr.get_window(jid, self.conn.name)
|
ctrl = gajim.interface.msg_win_mgr.get_sessionless_ctrl(jid, self.conn.name)
|
||||||
|
if ctrl:
|
||||||
if mw:
|
self.control = ctrl
|
||||||
ctrls = mw.sessionless_controls(self.conn.name, jid)
|
self.control.set_session(self)
|
||||||
|
self.control.parent_win.move_from_sessionless(self.control)
|
||||||
if len(ctrls):
|
first = False
|
||||||
ctrl = ctrls[0]
|
|
||||||
self.control = ctrl
|
|
||||||
ctrl.set_session(self)
|
|
||||||
ctrl.parent_win.move_from_sessionless(ctrl)
|
|
||||||
first = False
|
|
||||||
|
|
||||||
if pm:
|
if pm:
|
||||||
nickname = resource
|
nickname = resource
|
||||||
|
|
Loading…
Reference in New Issue