mirror of
https://github.com/FAUSheppy/atlantis-event-dispatcher
synced 2025-12-09 15:58:32 +01:00
fix: correctly confirm all relevant dispatches
..and not just the first
This commit is contained in:
@@ -66,13 +66,16 @@ def get_dispatch():
|
||||
|
||||
# accumulate messages by person #
|
||||
dispatch_by_person = dict()
|
||||
dispatch_secrets = []
|
||||
for dobj in dispatch_objects:
|
||||
if dobj.username not in dispatch_by_person:
|
||||
dispatch_by_person.update({ dobj.username : dobj.message })
|
||||
dispatch_secrets.append(dobj.dispatch_secret)
|
||||
else:
|
||||
dispatch_by_person[dobj.username] += "\n{}".format(dobj.message)
|
||||
dispatch_secrets.append(dobj.dispatch_secret)
|
||||
|
||||
response = [ { "person" : tupel[0], "message" : tupel[1], "method" : method, "uid" : dobj.dispatch_secret }
|
||||
response = [ { "person" : tupel[0], "message" : tupel[1], "method" : method, "uids" : dispatch_secrets }
|
||||
for tupel in dispatch_by_person.items() ]
|
||||
|
||||
return flask.jsonify(response)
|
||||
|
||||
Reference in New Issue
Block a user