mirror of
https://github.com/FAUSheppy/atlantis-event-dispatcher
synced 2025-12-06 06:21:36 +01:00
fix: support any-method for legacy signal query
This commit is contained in:
@@ -162,7 +162,10 @@ def get_dispatch():
|
|||||||
lines_timeout = lines_unfiltered.filter(DispatchObject.timestamp < timeout_cutoff_timestamp)
|
lines_timeout = lines_unfiltered.filter(DispatchObject.timestamp < timeout_cutoff_timestamp)
|
||||||
|
|
||||||
if method != "all":
|
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:
|
else:
|
||||||
dispatch_objects = lines_timeout.all()
|
dispatch_objects = lines_timeout.all()
|
||||||
|
|
||||||
@@ -185,6 +188,10 @@ def get_dispatch():
|
|||||||
dispatch_by_person[dobj.username] += "\n{}".format(dobj.message)
|
dispatch_by_person[dobj.username] += "\n{}".format(dobj.message)
|
||||||
dispatch_secrets.append(dobj.dispatch_secret)
|
dispatch_secrets.append(dobj.dispatch_secret)
|
||||||
|
|
||||||
|
# legacy hack #
|
||||||
|
if method == "any":
|
||||||
|
method = "signal"
|
||||||
|
|
||||||
response = [ { "person" : tupel[0].decode("utf-8"),
|
response = [ { "person" : tupel[0].decode("utf-8"),
|
||||||
"message" : tupel[1],
|
"message" : tupel[1],
|
||||||
"method" : method,
|
"method" : method,
|
||||||
|
|||||||
Reference in New Issue
Block a user