changeset 3e4932e1d12f in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=3e4932e1d12f description: print warning instead of traceback when we get a commands request from an invalid JID. Fixes #6995
diffstat:
src/common/commands.py | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-)
diffs (26 lines):
diff -r 88e755fb265b -r 3e4932e1d12f src/common/commands.py --- a/src/common/commands.py Fri Sep 30 10:10:36 2011 +0200 +++ b/src/common/commands.py Fri Sep 30 10:11:08 2011 +0200 @@ -27,6 +27,9 @@ import dataforms import gajim
+import logging +log = logging.getLogger('gajim.c.commands') + class AdHocCommand: commandnode = 'command' commandname = 'The Command' @@ -371,7 +374,11 @@ Send disco#info result for query for command (JEP-0050, example 6.). Return True if the result was sent, False if not """ - jid = helpers.get_full_jid_from_iq(iq_obj) + try: + jid = helpers.get_full_jid_from_iq(iq_obj) + except helpers.InvalidFormat: + log.warn('Invalid JID: %s, ignoring it' % iq_obj.getFrom()) + return node = iq_obj.getTagAttr('query', 'node')
if node not in self.__commands: return False