ignore wrong incomming jid from gajim-remote open_chat. see #2861

This commit is contained in:
Yann Leboulanger 2007-01-05 12:32:59 +00:00
parent ab4b14a228
commit 6076bd1028
1 changed files with 7 additions and 1 deletions

View File

@ -295,6 +295,11 @@ class SignalObject(dbus.service.Object):
raise MissingArgument raise MissingArgument
return None return None
jid = self._get_real_jid(jid, account) jid = self._get_real_jid(jid, account)
try:
jid = helpers.parse_jid(jid)
except:
# Jid is not conform, ignore it
return None
if account: if account:
accounts = [account] accounts = [account]
@ -564,6 +569,8 @@ class SignalObject(dbus.service.Object):
accounts = [account] accounts = [account]
else: else:
accounts = gajim.connections.keys() accounts = gajim.connections.keys()
if jid.startswith('xmpp://'):
return jid[7:] # len('xmpp://') = 7
if jid.startswith('xmpp:'): if jid.startswith('xmpp:'):
return jid[5:] # len('xmpp:') = 5 return jid[5:] # len('xmpp:') = 5
nick_in_roster = None # Is jid a nick ? nick_in_roster = None # Is jid a nick ?
@ -644,7 +651,6 @@ class SignalObject(dbus.service.Object):
break break
if not account: if not account:
account = gajim.contacts.get_accounts()[0] account = gajim.contacts.get_accounts()[0]
print account
if nick is None: if nick is None:
nick = '' nick = ''
gajim.interface.instances[account]['join_gc'] = \ gajim.interface.instances[account]['join_gc'] = \