Fixed SQL query to properly handle changed handles

This commit is contained in:
Klaus-Uwe Mitterer 2017-02-06 14:49:41 +01:00
parent 701afaef45
commit 67d0202b4d

View file

@ -107,7 +107,7 @@ def getFollowing(db=dbtools.dbHelper(), two=twitools.twObject(), firstrun=False)
def getNames(db = dbtools.dbHelper(), two = twitools.twObject()):
for user in twitools.getNamesByIDs(list(set(list(db.getFollowing()) + list(db.getFollowers())))):
if not db.matchNameID(user["name"], user["id"]):
db.executeQuery("UPDATE names SET `until` = %i WHERE `id` = '%s' AND `name` = '%s';" % (int(time.time()), str(user["id"]), str(user["name"])))
db.executeQuery("UPDATE names SET `until` = %i WHERE `id` = '%s';" % (int(time.time()), str(user["id"])))
db.executeQuery("INSERT INTO names VALUES('%s', '%s', %i, 0)" % (str(user["id"]), str(user["name"]), int(time.time())))
db.commit()