121
127
if not self.registryValue('enabled', channel):
124
id = db_run("INSERT INTO bans (channel, mask, operator, time, log) values(%s, %s, %s, %s, %s)",
130
id = self.db_run("INSERT INTO bans (channel, mask, operator, time, log) values(%s, %s, %s, %s, %s)",
125
131
(channel, target, nick, n, '\n'.join(self.logs[channel])), expect_id=True)
126
132
if kickmsg and id and not (kickmsg == nick):
127
db_run("INSERT INTO comments (ban_id, who, comment, time) values(%s,%s,%s,%s)", (id, nick, kickmsg, n))
133
self.db_run("INSERT INTO comments (ban_id, who, comment, time) values(%s,%s,%s,%s)", (id, nick, kickmsg, n))
129
135
def doUnban(self, irc, channel, nick, mask):
130
136
if not self.registryValue('enabled', channel):
132
data = db_run("SELECT MAX(id) FROM bans where channel=%s and mask=%s", (channel, mask), expect_result=True)
138
data = self.db_run("SELECT MAX(id) FROM bans where channel=%s and mask=%s", (channel, mask), expect_result=True)
133
139
if len(data) and not (data[0][0] == None):
134
db_run("UPDATE bans SET removal=%s , removal_op=%s WHERE id=%s", (now(), nick, int(data[0][0])))
140
self.db_run("UPDATE bans SET removal=%s , removal_op=%s WHERE id=%s", (now(), nick, int(data[0][0])))
136
142
def doPrivmsg(self, irc, msg):
137
143
(recipients, text) = msg.args