Esempio n. 1
0
 def add(self, sender, dest, arg):
     user, commands = arg.split(' ', 1)
     commands = commands.split(' ')
     for command in commands:
         ae = AuthEntry(user, command)
         db.session.save_or_update(ae)
     db.session.commit()
     helpers.msgOK(self.client, dest, parse_nick(sender)[0])
Esempio n. 2
0
 def list(self, sender, dest, arg=None):
     if arg:
         commands = AuthEntry.getForUser(arg)
     else:
         commands = AuthEntry.getAll()
     for command in commands:
         helpers.msg(self.client, dest, "%s: %s" % 
             (command.user, command.command))
     helpers.msgOK(self.client, dest, sender)
Esempio n. 3
0
 def remove(self, sender, dest, arg):
     user, commands = arg.split(' ', 1)
     commands = commands.split(' ')
     for command in commands:
         ae = AuthEntry.getForUser(user, command)
         if len(ae):
             db.session.delete(ae)
     db.session.commit()
     helpers.msgOK(self.client, dest, parse_nick(sender)[0])
Esempio n. 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)
Esempio n. 5
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)
Esempio n. 6
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])
Esempio n. 7
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])
Esempio n. 8
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])
Esempio n. 9
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])