fix updatebt, it failed to recognize extbans, and inserted them again in

the db.
This commit is contained in:
Elián Hanisch 2010-04-03 21:11:22 -03:00
parent b463ee3b26
commit 31a9820849

View File

@ -59,6 +59,8 @@ import hashlib
import threading
from collections import deque
isUserHostmask = ircutils.isUserHostmask
tz = 'UTC'
def now():
@ -842,7 +844,14 @@ class Bantracker(callbacks.Plugin):
def getBans(chan):
data = self.db_run("SELECT mask, removal FROM bans WHERE channel=%s", chan, expect_result=True)
return [i[0] for i in data if i[1] == None and "!" in i[0]]
L = []
for mask, removal in data:
if removal is not None:
continue
elif not isUserHostmask(mask) and mask[0] != '$':
continue
L.append(mask)
return L
def remBans(chan):
bans = getBans(chan)