From e52a8af0b47e7914461def4fe8afb1af3a7acbab Mon Sep 17 00:00:00 2001 From: rasmus Date: Fri, 8 Aug 2025 03:42:08 +0300 Subject: [PATCH] rename token to card (eventlog) not renaming inventory items, as they need migration refactor eventlog format, harmonized with inventory-app --- app/doorboy-proxy.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/doorboy-proxy.py b/app/doorboy-proxy.py index 85573e8..d89cdcb 100755 --- a/app/doorboy-proxy.py +++ b/app/doorboy-proxy.py @@ -150,7 +150,7 @@ async def view_longpoll(request): ev = event["fullDocument"] if ev["approved"] != "true": continue - if ev["type"] == "token": + if ev["type"] == "card": continue response.send("data: %s\n\n" % ev["door"]) @@ -203,18 +203,17 @@ async def swipe(request): event_swipe = { "component": "doorboy", - "method": "token", + "method": "card", "timestamp": timestamp, "door": data["door"], - "event": "card-swiped", "approved": data["approved"], - "uid_hash": data["uid_hash"], "user": { "id": token.get("inventory", {}).get("owner", {}).get("username", ""), "name": token.get("inventory", {}) .get("owner", {}) .get("display_name", "Unclaimed Token"), }, + "uid_hash": data["uid_hash"], } await app.ctx.db.eventlog.insert_one(event_swipe)