if jid is not a conntact, open-chat with first connected account

This commit is contained in:
Dimitur Kirov 2005-09-13 14:15:13 +00:00
parent 7e69565a0f
commit 7495464de7
1 changed files with 8 additions and 0 deletions

View File

@ -214,6 +214,7 @@ class SignalObject(DbusPrototype):
if len(accounts) == 1: if len(accounts) == 1:
account = accounts[0] account = accounts[0]
connected_account = None connected_account = None
first_connected = None
for acct in accounts: for acct in accounts:
if gajim.connections[acct].connected > 1: # account is online if gajim.connections[acct].connected > 1: # account is online
if self.plugin.windows[acct]['chats'].has_key(jid): if self.plugin.windows[acct]['chats'].has_key(jid):
@ -227,6 +228,13 @@ class SignalObject(DbusPrototype):
# or there is only one account # or there is only one account
elif account: elif account:
connected_account = acct connected_account = acct
elif first_connected is None:
first_connected = acct
# if jid is not a conntact, open-chat with first connected account
if connected_account is None and first_connected:
connected_account = first_connected
if connected_account: if connected_account:
self.plugin.roster.new_chat_from_jid(connected_account, jid) self.plugin.roster.new_chat_from_jid(connected_account, jid)
# preserve the 'steal focus preservation' # preserve the 'steal focus preservation'