Rename 'message' to 'msg' and 'target' to 'channel'

This commit is contained in:
2019-10-05 00:51:00 +01:00
parent ddadeb617c
commit 78e4d6bd66
3 changed files with 25 additions and 25 deletions

View File

@@ -54,8 +54,8 @@ def magicFunction(A, B):
return all(A[k] in B[k] for k in set(A) & set(B)) and set(B) <= set(A)
def event(numName, c): # yes I'm using a short variable because otherwise it goes off the screen
if not "target" in c.keys():
c["target"] = None
if not "channel" in c.keys():
c["channel"] = None
if dedup(numName, c):
return
@@ -68,13 +68,13 @@ def event(numName, c): # yes I'm using a short variable because otherwise it goe
userinfo.renameUser(c["name"], c["nick"], c["muser"], c["user"], c["user"]+"!"+c["ident"]+"@"+c["host"])
elif c["type"] == "kick":
userinfo.editUser(c["name"], c["muser"])
userinfo.delUserByNick(c["name"], c["target"], c["user"])
userinfo.delUserByNick(c["name"], c["channel"], c["user"])
elif c["type"] == "quit":
userinfo.delUserByNetwork(c["name"], c["nick"], c["muser"])
elif c["type"] == "join":
userinfo.addUser(c["name"], c["target"], c["nick"], c["muser"])
userinfo.addUser(c["name"], c["channel"], c["nick"], c["muser"])
elif c["type"] == "part":
userinfo.delUser(c["name"], c["target"], c["nick"], c["muser"])
userinfo.delUser(c["name"], c["channel"], c["nick"], c["muser"])
if "mtype" in c.keys():
if c["mtype"] == "nick":
@@ -85,7 +85,7 @@ def event(numName, c): # yes I'm using a short variable because otherwise it goe
sendRelayNotification(c)
# only monitors below
monitorGroups = testNetTarget(c["name"], c["target"])
monitorGroups = testNetTarget(c["name"], c["channel"])
if monitorGroups == False:
return
for monitorGroup in monitorGroups:
@@ -95,11 +95,11 @@ def event(numName, c): # yes I'm using a short variable because otherwise it goe
if "send" in main.monitor[monitorGroup].keys():
for i in main.monitor[monitorGroup]["send"].keys():
if isinstance(main.monitor[monitorGroup]["send"][i], bool):
sendRelayNotification({"type": "err", "name": name, "target": target, "message": c, "reason": "errdeliv"})
sendRelayNotification({"type": "err", "name": name, "channel": channel, "message": c, "reason": "errdeliv"})
continue
if not i in main.pool.keys():
sendRelayNotification({"type": "err", "name": name, "target": target, "message": c, "reason": "noname"})
sendRelayNotification({"type": "err", "name": name, "channel": channel, "message": c, "reason": "noname"})
if not i in main.IRCPool.keys():
sendRelayNotification({"type": "err", "name": name, "target": target, "message": c, "reason": "noinstance"})
sendRelayNotification({"type": "err", "name": name, "channel": channel, "message": c, "reason": "noinstance"})
for x in main.monitor[monitorGroup]["send"][i]:
main.IRCPool[i].msg(x, "monitor [%s] (%s) %s" % (monitorGroup, c["name"], c))