summaryrefslogtreecommitdiff
path: root/src/core.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2012-08-08 23:59:00 +0200
committermathieui <mathieui@mathieui.net>2012-08-08 23:59:00 +0200
commit9fec12425073b80a4b9fd9c6164ddb4f5375e6d3 (patch)
tree064579343360819fa4087776c68097368f552945 /src/core.py
parente8dce570eac86cb9b888a61776ca5c858c03a1aa (diff)
downloadpoezio-9fec12425073b80a4b9fd9c6164ddb4f5375e6d3.tar.gz
poezio-9fec12425073b80a4b9fd9c6164ddb4f5375e6d3.tar.bz2
poezio-9fec12425073b80a4b9fd9c6164ddb4f5375e6d3.tar.xz
poezio-9fec12425073b80a4b9fd9c6164ddb4f5375e6d3.zip
Fix yet another bunch of potential tracebacks
(notably, the /message one) All JID calls in poezio’s code were already covered, but sleekxmpp does that, too, so each jid given to sleek must be validated, otherwise an unwanted exception may occur.
Diffstat (limited to 'src/core.py')
-rw-r--r--src/core.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/core.py b/src/core.py
index 519e82a3..5ed1cd17 100644
--- a/src/core.py
+++ b/src/core.py
@@ -826,7 +826,7 @@ class Core(object):
Disable private tabs when leaving a room
"""
for tab in self.tabs:
- if tab.get_name().startswith(room_name) and isinstance(tab, tabs.PrivateTab):
+ if isinstance(tab, tabs.PrivateTab) and tab.get_name().startswith(room_name):
tab.deactivate(reason=reason)
def enable_private_tabs(self, room_name, reason='\x195}You joined the chatroom\x193}'):
@@ -1909,8 +1909,8 @@ class Core(object):
if len(args) < 2:
return
reason = args[2] if len(args) > 2 else ''
- to = args[0]
- room = args[1]
+ to = safeJID(args[0])
+ room = safeJID(args[1])
self.xmpp.plugin['xep_0045'].invite(room, to, reason)
def completion_invite(self, the_input):
@@ -2058,8 +2058,10 @@ class Core(object):
if len(args) < 1:
self.command_help('message')
return
- jid = args[0]
- tab = self.open_conversation_window(jid, focus=True)
+ jid = safeJID(args[0])
+ if not jid.user and not jid.domain and not jid.resource:
+ return self.information('Invalid JID.', 'Error')
+ tab = self.open_conversation_window(jid.full, focus=True)
if len(args) > 1:
tab.command_say(args[1])