From d0109e080a8436e46e05e2b066c34d1ababb81c3 Mon Sep 17 00:00:00 2001 From: Yannik Schmidt Date: Mon, 19 Feb 2024 16:14:08 +0100 Subject: [PATCH] fix: support any-method for legacy signal query --- server/interface.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server/interface.py b/server/interface.py index e1153ed..5c5f85f 100755 --- a/server/interface.py +++ b/server/interface.py @@ -162,7 +162,10 @@ def get_dispatch(): lines_timeout = lines_unfiltered.filter(DispatchObject.timestamp < timeout_cutoff_timestamp) if method != "all": - dispatch_objects = lines_timeout.filter(DispatchObject.method == method).all() + dispatch_objects = lines_timeout.filter(DispatchObject.method==method).all() + user_settings = db.session.query(UserSettings).filter(UserSettings.user==user) + if method == user_settings.get_highest_prio_method(): + dispatch_objects += lines_timeout.filter(DispatchObject.method=="any").all() else: dispatch_objects = lines_timeout.all() @@ -185,6 +188,10 @@ def get_dispatch(): dispatch_by_person[dobj.username] += "\n{}".format(dobj.message) dispatch_secrets.append(dobj.dispatch_secret) + # legacy hack # + if method == "any": + method = "signal" + response = [ { "person" : tupel[0].decode("utf-8"), "message" : tupel[1], "method" : method,