Beispiel #1
0
 def join(self, prefix, arg):
     log.info('join %s %s' % (prefix, arg))
     name = parse_name(prefix)[0]
     msgs = TellMessage.getForUser(name, arg)
     for msg in msgs:
         helpers.msg(self.client, arg, "%s: %s said to tell you %s" %
             (msg.to_user, msg.from_user, msg.msg))
         db.session.delete(msg)
     db.session.commit()
Beispiel #2
0
 def join(self, prefix, arg):
     log.info('join %s %s' % (prefix, arg))
     name = parse_name(prefix)[0]
     msgs = TellMessage.getForUser(name, arg)
     for msg in msgs:
         helpers.msg(
             self.client, arg, "%s: %s said to tell you %s" %
             (msg.to_user, msg.from_user, msg.msg))
         db.session.delete(msg)
     db.session.commit()
Beispiel #3
0
    def __call__(self, sender, dest, arg):
        t = arg.split(' ', 1)
        target, message = t[0], t[1]
        sender = parse_name(sender)[0]

        if TellMessage.getCountForUser(target) >= int(config['tell']['max_msgs']):
            helpers.msg(self.client, dest, "%s has too many messages already" % target)
            return

        msg = TellMessage(sender, target, dest, message)
        db.session.save(msg)
        db.session.commit()
        helpers.msgOK(self.client, dest, sender)
Beispiel #4
0
    def __call__(self, sender, dest, arg):
        t = arg.split(' ', 1)
        target, message = t[0], t[1]
        sender = parse_name(sender)[0]

        if TellMessage.getCountForUser(target) >= int(
                config['tell']['max_msgs']):
            helpers.msg(self.client, dest,
                        "%s has too many messages already" % target)
            return

        msg = TellMessage(sender, target, dest, message)
        db.session.save(msg)
        db.session.commit()
        helpers.msgOK(self.client, dest, sender)
Beispiel #5
0
 def delete(self, sender, dest, arg):
     """ delete an insult, arg is insult id """
     insult = Insult.get(int(arg))   
     db.session.delete(insult)
     db.session.commit()
     helpers.msgOK(self.client, dest, parse_name(sender)[0])
Beispiel #6
0
 def add(self, sender, dest, arg):
     """ add an insult to the datbase """
     insult = Insult(arg)
     db.session.save(insult)
     db.session.commit()
     helpers.msgOK(self.client, dest, parse_name(sender)[0])
Beispiel #7
0
 def list(self, sender, dest):
     """ list all insults """
     sender = parse_name(sender)[0]
     for insult in Insult.getAll():
         helpers.msg(self.client, sender, "%s: %s" % (insult.id, insult.insult))
Beispiel #8
0
 def __call__(self, sender, dest, arg=None):
     t = (arg or parse_name(sender)[0]).split(' ', 1)
     target, id = t[0], t[1:]
     
     helpers.msg(self.client, dest, "%s %s" % (target, 
         Insult.get(id[0]) if id else Insult.getRandom()) )
Beispiel #9
0
 def delete(self, sender, dest, arg):
     """ delete an insult, arg is insult id """
     insult = Insult.get(int(arg))
     db.session.delete(insult)
     db.session.commit()
     helpers.msgOK(self.client, dest, parse_name(sender)[0])
Beispiel #10
0
 def list(self, sender, dest):
     """ list all insults """
     sender = parse_name(sender)[0]
     for insult in Insult.getAll():
         helpers.msg(self.client, sender, "%s: %s" % (insult.id, insult.insult))
Beispiel #11
0
 def add(self, sender, dest, arg):
     """ add an insult to the datbase """
     insult = Insult(arg)
     db.session.save(insult)
     db.session.commit()
     helpers.msgOK(self.client, dest, parse_name(sender)[0])
Beispiel #12
0
    def __call__(self, sender, dest, arg=None):
        t = (arg or parse_name(sender)[0]).split(' ', 1)
        target, id = t[0], t[1:]

        helpers.msg(self.client, dest, "%s %s" % (target,
            Insult.get(id[0]) if id else Insult.getRandom()) )