Implement a single function for all callbacks from IRC hooks and send a seperate notification if an action takes place that concerns a bot

This commit is contained in:
2019-08-11 20:52:10 +01:00
parent 56840e0060
commit 2757256d4f
10 changed files with 106 additions and 113 deletions

View File

@@ -76,7 +76,7 @@ def initialNames(name, channel, names):
p.sadd("live.chan."+name+"."+i, channel)
p.execute()
def editUser(name, channel, nick, user):
def editUser(name, user):
gnamespace = "live.who.%s" % name
main.r.sadd(gnamespace, user)
@@ -151,7 +151,7 @@ def delUserByNetwork(name, nick, user):
p.delete(chanspace)
p.execute()
def delChannel(name, channel):
def delChannel(name, channel): # This function is extremely expensive, look to replace
gnamespace = "live.who.%s" % name
namespace = "live.who.%s.%s" % (name, channel)
p = main.r.pipeline()
@@ -171,4 +171,5 @@ def delNetwork(name, channels):
log("Purging channels for %s" % name)
for i in channels:
delChannel(name, i)
log("Finished purging channels for %s" % name)
return