Fix various bugs in the event system

Squash many bugs in the event notification system and simplify the
code.
This commit is contained in:
2020-06-02 21:34:15 +01:00
parent 290e0b5f87
commit 1640955e5c
4 changed files with 71 additions and 49 deletions

View File

@@ -1,6 +1,5 @@
from copy import deepcopy
from json import dumps
from datetime import datetime
import main
from core.relay import sendRelayNotification
@@ -9,8 +8,8 @@ from modules import regproc
from utils.dedup import dedup
order = ["type", "net", "num", "channel", "msg", "nick",
"ident", "host", "mtype", "user", "modes", "modeargs"
"realname", "server", "status"]
"ident", "host", "mtype", "user", "mode", "modearg",
"realname", "server", "status", "time"]
def testNetTarget(name, target):
called = False
@@ -88,6 +87,7 @@ def event(numName, c): # yes I'm using a short variable because otherwise it goe
if "muser" in c.keys():
del c["muser"]
sendRelayNotification({k: c[k] for k in order if k in c}) # Sort dict keys according to order
# only monitors below