+ def message_chat(self, m):
+ command = ""
+ for e in m.elements():
+ if e.name == "body":
+ command = "%s" % e
+ break
+
+ if command == "list groups":
+ def list_groups(iq):
+ reply = ""
+ for i in iq.query.elements():
+ reply += "%s\n" % i['node']
+ n = domish.Element((None, "message"))
+ n['to'] = m['from']
+ n['from'] = self.id.full()
+ n.addElement("body", content = reply)
+ self.xmlstream.send(n)
+
+ self.add_result_hook("discover", list_groups)
+ self.discover()
+
+ else:
+ BaseClient.message_chat(self, m)