fix: support any-method for legacy signal query

This commit is contained in:
2024-02-19 16:14:08 +01:00
parent a2b045cf97
commit d0109e080a

View File

@@ -163,6 +163,9 @@ def get_dispatch():
if 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,