def post(self): sender = bare_jid(self.request.get('from')) if sender == BOSS_JID: '''parse a new cmd and save it.''' message = xmpp.Message(self.request.POST) logging.info('BOSS command: %s' % message.body) try: recv, cmd = message.body.split('++') if ' <mailto:' in recv: # Fix iMessager [email protected]<mailto:[email protected]> recv = recv.split(' <mailto:')[0] except ValueError: message.reply('Are you kidding me? Why are you saying "%s"' % message.body) else: logging.info('caching comamnd %s for %s' % (cmd, recv)) Command.putCmdFor(cmd, recv) message.reply('cached for [%s]' % recv) #TODO: validate if sender a real server else: '''not boss, do nothing''' pass