示例#1
0
 def post(self):
     message = xmpp.Message(self.request.POST)
     msg = message.body.strip(" ")  # get the msg
     add = message.sender.split("/")[0].lower()  # get the sender email address
     tservice = TService()
     if tservice.isCommand(msg):
         respon = tservice.parseCommand(msg, add)
         message.reply(respon)
     else:
         respon = tservice.sentMsg(msg.encode("utf8"), add)
         if respon <> "200":
             message.reply(respon)
示例#2
0
 def get(self):
     ts=TService()
     ts.recMsg('TwiDbJ')