Exemplo n.º 1
0
Arquivo: xmpp.py Projeto: revcozmo/err
 def incoming_message(self, xmppmsg):
     """Callback for message events"""
     msg = Message(xmppmsg['body'])
     if 'html' in xmppmsg.keys():
         msg.html = xmppmsg['html']
     msg.frm = xmppmsg['from'].full
     msg.to = xmppmsg['to'].full
     msg.type = xmppmsg['type']
     msg.nick = xmppmsg['mucnick']
     msg.delayed = bool(xmppmsg['delay']._get_attr('stamp'))  # this is a bug in sleekxmpp it should be ['from']
     self.callback_message(msg)
Exemplo n.º 2
0
 def incoming_message(self, xmppmsg):
     """Callback for message events"""
     msg = Message(xmppmsg['body'])
     if 'html' in xmppmsg.keys():
         msg.html = xmppmsg['html']
     msg.frm = xmppmsg['from'].full
     msg.to = xmppmsg['to'].full
     msg.type = xmppmsg['type']
     msg.nick = xmppmsg['mucnick']
     msg.delayed = bool(xmppmsg['delay']._get_attr('stamp'))  # this is a bug in sleekxmpp it should be ['from']
     self.callback_message(msg)
Exemplo n.º 3
0
 def incoming_message(self, xmppmsg):
     """Callback for message events"""
     msg = Message(xmppmsg['body'])
     if 'html' in xmppmsg.keys():
         msg.html = xmppmsg['html']
     msg.frm = self.build_identifier(xmppmsg['from'].full)
     msg.to = self.build_identifier(xmppmsg['to'].full)
     log.debug("incoming_message frm : %s" % msg.frm)
     log.debug("incoming_message frm node: %s" % msg.frm.node)
     log.debug("incoming_message frm domain: %s" % msg.frm.domain)
     log.debug("incoming_message frm resource: %s" % msg.frm.resource)
     msg.type = xmppmsg['type']
     if msg.type == 'groupchat':
         # those are not simple identifiers, they are muc occupants.
         msg.frm = XMPPMUCOccupant(msg.frm.node, msg.frm.domain, msg.frm.resource)
         msg.to = XMPPMUCOccupant(msg.to.node, msg.to.domain, msg.to.resource)
     msg.nick = xmppmsg['mucnick']
     msg.delayed = bool(xmppmsg['delay']._get_attr('stamp'))  # this is a bug in sleekxmpp it should be ['from']
     self.callback_message(msg)
Exemplo n.º 4
0
Arquivo: xmpp.py Projeto: Kelur/errbot
 def incoming_message(self, xmppmsg):
     """Callback for message events"""
     msg = Message(xmppmsg["body"])
     if "html" in xmppmsg.keys():
         msg.html = xmppmsg["html"]
     msg.frm = self.build_identifier(xmppmsg["from"].full)
     msg.to = self.build_identifier(xmppmsg["to"].full)
     log.debug("incoming_message frm : %s" % msg.frm)
     log.debug("incoming_message frm node: %s" % msg.frm.node)
     log.debug("incoming_message frm domain: %s" % msg.frm.domain)
     log.debug("incoming_message frm resource: %s" % msg.frm.resource)
     msg.type = xmppmsg["type"]
     if msg.type == "groupchat":
         # those are not simple identifiers, they are muc occupants.
         msg.frm = XMPPMUCOccupant(msg.frm.node, msg.frm.domain, msg.frm.resource)
         msg.to = XMPPMUCOccupant(msg.to.node, msg.to.domain, msg.to.resource)
     msg.nick = xmppmsg["mucnick"]
     msg.delayed = bool(xmppmsg["delay"]._get_attr("stamp"))  # this is a bug in sleekxmpp it should be ['from']
     self.callback_message(msg)
Exemplo n.º 5
0
 def incoming_message(self, xmppmsg):
     """Callback for message events"""
     msg = Message(xmppmsg['body'])
     if 'html' in xmppmsg.keys():
         msg.html = xmppmsg['html']
     msg.frm = self.build_identifier(xmppmsg['from'].full)
     msg.to = self.build_identifier(xmppmsg['to'].full)
     log.debug("incoming_message frm : %s" % msg.frm)
     log.debug("incoming_message frm node: %s" % msg.frm.node)
     log.debug("incoming_message frm domain: %s" % msg.frm.domain)
     log.debug("incoming_message frm resource: %s" % msg.frm.resource)
     msg.type = xmppmsg['type']
     if msg.type == 'groupchat':
         # those are not simple identifiers, they are muc occupants.
         msg.frm = XMPPMUCOccupant(msg.frm.node, msg.frm.domain,
                                   msg.frm.resource)
         msg.to = XMPPMUCOccupant(msg.to.node, msg.to.domain,
                                  msg.to.resource)
     msg.nick = xmppmsg['mucnick']
     msg.delayed = bool(xmppmsg['delay']._get_attr(
         'stamp'))  # this is a bug in sleekxmpp it should be ['from']
     self.callback_message(msg)