mirror of
https://github.com/FAUSheppy/atlantis-event-dispatcher
synced 2025-12-06 06:21:36 +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)
|
||||
|
||||
@@ -50,7 +50,7 @@ if __name__ == "__main__":
|
||||
|
||||
user = entry["person"]
|
||||
message = entry["message"]
|
||||
uid = entry["uid"]
|
||||
uid_list = entry["uids"]
|
||||
|
||||
# send message #
|
||||
if entry["method"] == "signal":
|
||||
@@ -60,6 +60,7 @@ if __name__ == "__main__":
|
||||
|
||||
# confirm dispatch
|
||||
if not args.no_confirm:
|
||||
confirm_dispatch(args.target, uid)
|
||||
for uid in uid_list:
|
||||
confirm_dispatch(args.target, uid)
|
||||
|
||||
sys.exit(0)
|
||||
|
||||
Reference in New Issue
Block a user