comparison src/core/xmpp.py @ 527:9a3913fb0a6c

plugin text commands: added /parrot and /unparrot commands to use Parrot plugin - /parrot command add parrot link between the current entity/room and the entity given as an argument (must be a valid jid) - similarly, /unparrot remove the 2 links between those entities. - Parrot is a new dependency of text commands
author Goffi <goffi@goffi.org>
date Sun, 21 Oct 2012 19:46:08 +0200
parents b7577230a7c8
children 2c4016921403
comparison
equal deleted inserted replaced
526:d67f0ce83530 527:9a3913fb0a6c
104 xmppim.MessageProtocol.__init__(self) 104 xmppim.MessageProtocol.__init__(self)
105 self.host = host 105 self.host = host
106 106
107 def onMessage(self, message): 107 def onMessage(self, message):
108 debug (_(u"got message from: %s"), message["from"]) 108 debug (_(u"got message from: %s"), message["from"])
109 if not self.host.trigger.point("MessageReceived",message, profile=self.parent.profile): 109 if not self.host.trigger.point("MessageReceived", message, profile=self.parent.profile):
110 return 110 return
111 for e in message.elements(): 111 for e in message.elements():
112 if e.name == "body": 112 if e.name == "body":
113 mess_type = message['type'] if message.hasAttribute('type') else 'normal' 113 mess_type = message['type'] if message.hasAttribute('type') else 'normal'
114 mess_body = e.children[0] if e.children else "" 114 mess_body = e.children[0] if e.children else ""