Deal with directed messages (in a MUC room for example)
authorMikael Berthe <mikael@lilotux.net>
Tue, 01 May 2007 13:34:55 +0200
changeset 5 0cc11f58b34e
parent 4 3454a7b7c818
child 6 ad3de9374276
Deal with directed messages (in a MUC room for example)
neutron.py
--- a/neutron.py	Tue May 01 13:33:46 2007 +0200
+++ b/neutron.py	Tue May 01 13:34:55 2007 +0200
@@ -380,6 +380,12 @@
 		command = string.lower(string.split(body)[0])
 		if body.count(' '):
 			parameters = body[(body.find(' ') + 1):]
+		if command == 'mcbot:' and parameters > 1:
+			command = string.lower(string.split(body)[1])
+			if parameters.count(' '):
+				parameters = parameters[(parameters.find(' ') + 1):]
+			else:
+				parameters = ''
 	if not msg.timestamp:
 		if msgtype == 'groupchat':
 				call_message_handlers('public', [fromjid, fromjid.getStripped(), fromjid.getResource()], body)