Exemplo n.º 1
0
 def post(self):
     # sender = self.request.get('from').split('/')[0]
     sender = xmpp_api.get_mail_name(self.request.get("from")).lower()
     if funcs.isInGroupUser(sender):
         funcs.delUserFromOnlineUserList(sender)
     else:
         logging.error("error sender %s incoming offline" % sender)
Exemplo n.º 2
0
 def post(self):
     #sender = self.request.get('from').split('/')[0]
     sender = xmpp_api.get_mail_name(self.request.get('from')).lower()
     if funcs.isInGroupUser(sender):
         funcs.delUserFromOnlineUserList(sender)
     else:
         logging.error('error sender %s incoming offline' % sender)
Exemplo n.º 3
0
 def post(self):
     # sender = self.request.get('from').split('/')[0]
     sender = xmpp_api.get_mail_name(self.request.get("from")).lower()
     if funcs.isInGroupUser(sender):
         funcs.addUserToOnlineUserList(sender)
Exemplo n.º 4
0
 message = None
 try:
     message = xmpp.Message(self.request.POST)
 except xmpp.InvalidMessageError, e:
     logging.error("Invalid XMPP request: %s", e[0])
     logging.error(self.request.body)
     logging.error(self.request.POST)
     return
 except:
     # from_name=m2ggg_core.get_mail_name(self.request.get('from')).lower()
     # m2ggg_core.activeresouce_record(from_name,4);
     from_name = self.request.get("from")
     logging.error(sys.exc_info()[0])
     raise "under attack:" + from_name.encode("UTF-8")
     return
 from_name = xmpp_api.get_mail_name(self.request.get("from")).lower()
 msgbody = funcs.MsgBlankClean(message.body)
 e = cmddiv.MsgCheckCmd(from_name, msgbody)
 if e == "NOTCMD":
     if not funcs.isInGroupUser(from_name):
         message.reply(
             "u r NOT in this group,pls join first,see more http://code.google.com/p/twpost/wiki/xixiguys_start"
         )
         return
     if len(msgbody) > 1024:
         message.reply("error:msg too long(<=1024)")
         return
     e = funcs.broastcastMsg(msgbody, from_name, False)
     funcs.updateUserCount(from_name)
     # funcs.Add2OnlineList(from_name)
 else:
Exemplo n.º 5
0
 def post(self):
     #sender = self.request.get('from').split('/')[0]
     sender = xmpp_api.get_mail_name(self.request.get('from')).lower()
     if funcs.isInGroupUser(sender):
         funcs.addUserToOnlineUserList(sender)
Exemplo n.º 6
0
 message = None
 try:
     message = xmpp.Message(self.request.POST)
 except xmpp.InvalidMessageError, e:
     logging.error("Invalid XMPP request: %s", e[0])
     logging.error(self.request.body)
     logging.error(self.request.POST)
     return
 except:
     #from_name=m2ggg_core.get_mail_name(self.request.get('from')).lower()
     #m2ggg_core.activeresouce_record(from_name,4);
     from_name = self.request.get('from')
     logging.error(sys.exc_info()[0])
     raise "under attack:" + from_name.encode("UTF-8")
     return
 from_name = xmpp_api.get_mail_name(self.request.get('from')).lower()
 msgbody = funcs.MsgBlankClean(message.body)
 e = cmddiv.MsgCheckCmd(from_name, msgbody)
 if e == 'NOTCMD':
     if not funcs.isInGroupUser(from_name):
         message.reply(
             'u r NOT in this group,pls join first,see more http://code.google.com/p/twpost/wiki/xixiguys_start'
         )
         return
     if len(msgbody) > 1024:
         message.reply('error:msg too long(<=1024)')
         return
     e = funcs.broastcastMsg(msgbody, from_name, False)
     funcs.updateUserCount(from_name)
     #funcs.Add2OnlineList(from_name)
 else: