diff --git a/core/runtime/__pycache__/applyconditions.cpython-314.pyc b/core/runtime/__pycache__/applyconditions.cpython-314.pyc index 0841e47..f69e748 100644 Binary files a/core/runtime/__pycache__/applyconditions.cpython-314.pyc and b/core/runtime/__pycache__/applyconditions.cpython-314.pyc differ diff --git a/core/runtime/applyconditions.py b/core/runtime/applyconditions.py index 7cd6287..1dbff6f 100644 --- a/core/runtime/applyconditions.py +++ b/core/runtime/applyconditions.py @@ -1,26 +1,32 @@ -def applyConditions(definition, outputs): +def applyConditions(definition, dictionary): if hasattr(definition, "filters"): + print("DEBUG DICTIONARY PASS") + print(dictionary) for filter in definition.filters: - print("DEBUG applyConditons filter item consumption") - print(outputs["event"]) - - item = outputs["event"] - - #current_value = item[filter["filterkey"]] if filter["operator"] == ">=": - if item[filter["filterkey"]] >= filter["filtervalue"]: - print("Applying filters") + if dictionary.get(filter["filterkey"]) >= filter["filtervalue"]: + print(filter["print"]) + return True + + if filter["operator"] == "<=": + if dictionary.get(filter["filterkey"]) <= filter["filtervalue"]: + print(filter["print"]) return True if filter["operator"] == "==": - if item[filter["filterkey"]] == filter["filtervalue"]: - print("Applying filters") + if dictionary.get(filter["filterkey"]) == filter["filtervalue"]: + print(filter["print"]) + return True + + if filter["operator"] == "!=": + if dictionary.get(filter["filterkey"]) != filter["filtervalue"]: + print(filter["print"]) return True if filter["operator"] == "in": - if filter["filtervalue"] in outputs[filter["filterkey"]]: - print("Applying filters") + if filter["filtervalue"] in dictionary: + print(filter["print"]) return True return False \ No newline at end of file diff --git a/core/server/__pycache__/createlistener.cpython-314.pyc b/core/server/__pycache__/createlistener.cpython-314.pyc index fd42732..b2b6712 100644 Binary files a/core/server/__pycache__/createlistener.cpython-314.pyc and b/core/server/__pycache__/createlistener.cpython-314.pyc differ diff --git a/core/server/createlistener.py b/core/server/createlistener.py index 75faac2..9b67f13 100644 --- a/core/server/createlistener.py +++ b/core/server/createlistener.py @@ -25,14 +25,14 @@ def buildListener(listener, self): for item in outputs[listener.recursive["source"]]: - outputs[listener.recursive["label"]] = item + #outputs[listener.recursive["label"]] = item - print("DEBUG item selection") + #print("DEBUG item selection") #print(listener.recursive["label"]) - print(item) - print(outputs["event"]) + #print(item) + #print(outputs["event"]) - if applyConditions(listener, outputs): + if applyConditions(listener, item): continue #if "state_key" in event: diff --git a/plugins/rmass/listeners/__pycache__/synapselistener.cpython-314.pyc b/plugins/rmass/listeners/__pycache__/synapselistener.cpython-314.pyc index 2440a4a..2680e5d 100644 Binary files a/plugins/rmass/listeners/__pycache__/synapselistener.cpython-314.pyc and b/plugins/rmass/listeners/__pycache__/synapselistener.cpython-314.pyc differ diff --git a/plugins/rmass/listeners/synapselistener.py b/plugins/rmass/listeners/synapselistener.py index 09c9a86..02a84aa 100644 --- a/plugins/rmass/listeners/synapselistener.py +++ b/plugins/rmass/listeners/synapselistener.py @@ -23,16 +23,19 @@ filters = [ "filterkey": "event", "operator": "in", "filtervalue": "state_key", + "print": "Excluding state.key event", }, { "filterkey": "sender", "operator": "!=", "filtervalue": "@lyncoln:loxthelion.com", + "print": "Excluding message loop item", }, { "filterkey": "type", - "operator": "==", + "operator": "!=", "filtervalue": "m.room.message", + "print": "Excluding non-room message event", }, ] diff --git a/savedata/rmmanager.db b/savedata/rmmanager.db index 8b30ea3..b669e95 100644 Binary files a/savedata/rmmanager.db and b/savedata/rmmanager.db differ diff --git a/savedata/tokens.json b/savedata/tokens.json index 4f64dc8..4889e90 100644 --- a/savedata/tokens.json +++ b/savedata/tokens.json @@ -1 +1 @@ -{"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJleHAiOjE3OTIyNDQyMTEsIm5iZiI6MTc5MjI0NDAzMSwic3ViIjoiMjM4MzAyIiwidXNlcm5hbWUiOiJYeHhvdGlxIiwidXNlclR5cGUiOjEsInN0YWdlTmFtZSI6Ilh4eG90aXEiLCJhcHByb3ZlZCI6MSwibG9jYXRpb25JZCI6NDcyLCJzZWFyY2hDaXR5IjoiYXRsYW50Y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0.BhkAmkCuSMtld_oI10-bW_MsBTKiCCiZfg61LMY00-N2tdnY2YMKagx3dRZZJNgHWX01kXHTC2x-O0K9IuWzaQ", "refresh_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJleHAiOjE3OTQ4NDMzNjAsIm5iZiI6MTc5MjI1MTMwMCwianRpIjoicE5VL1Q5WEh1QlBwc1l3YTlwZ0t3TGh1c3VLdDJVdFhoZUNuZGM3M0QvYz0iLCJpc3MiOiJodHRwczovL3JlbnRtYXNzZXVyLmNvbSIsImlhdCI6MTc5MjI1MTM2MCwic3ViIjoiMjM4MzAyIn0.RahV0ZwvoAvRjPSFeza1eP7EHoP8zK4JFUIh7L7U9Pe9MCcJEaWoi7b7y0vXvbPSx3uMbkxzgOsMI8WYYtPRKA"} \ No newline at end of file