Skip to content

Commit

Permalink
Add inbox_state logs
Browse files Browse the repository at this point in the history
  • Loading branch information
bradtgmurray authored and Fizzadar committed Jan 24, 2023
1 parent 5a78330 commit 3500b6f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions synapse/rest/client/account_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,6 @@ class RoomBeeperInboxStateServlet(RestServlet):
"/com.beeper.inbox/user/(?P<user_id>[^/]*)/rooms/(?P<room_id>[^/]*)/inbox_state",
releases=(), # not in the matrix spec, only include under /unstable
)
) + list(
# Improperly namespaced version of the above endpoint (TODO: remove once everything uses the namespaced version)
client_patterns(
"/user/(?P<user_id>[^/]*)/rooms/(?P<room_id>[^/]*)/beeper_inbox_state"
)
)

def __init__(self, hs: "HomeServer"):
Expand Down Expand Up @@ -313,12 +308,15 @@ async def on_PUT(
await self.handler.add_account_data_to_room(
user_id, room_id, "m.marked_unread", marked_unread
)
logger.info(f"SetBeeperMarkedUnread marked_unread={body['marked_unread']}")

if "done" in body:
done = {"updated_ts": ts, "at_ts": ts + body["done"].get("at_delta", 0)}
delta_ms = body["done"].get("at_delta", 0)
done = {"updated_ts": ts, "at_ts": ts + delta_ms}
await self.handler.add_account_data_to_room(
user_id, room_id, "com.beeper.inbox.done", done
)
logger.info(f"SetBeeperDone done_delta_ms={delta_ms}")

return 200, {}

Expand Down

0 comments on commit 3500b6f

Please sign in to comment.