Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
BE-13042: In inbox_state, set com.beeper.inbox.done before m.marked_u…
Browse files Browse the repository at this point in the history
…nread (#76)

In inbox_state, set com.beeper.inbox.done before m.marked_unread
  • Loading branch information
adamvy authored Jul 13, 2023
1 parent b658fae commit 560d9f7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions synapse/rest/client/account_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,13 +360,6 @@ async def on_PUT(

body = parse_json_object_from_request(request)

if "marked_unread" in body:
marked_unread = {"unread": body["marked_unread"], "ts": ts}
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:
delta_ms = body["done"].get("at_delta") or 0
done = {"updated_ts": ts, "at_ts": ts + delta_ms}
Expand All @@ -375,6 +368,13 @@ async def on_PUT(
)
logger.info(f"SetBeeperDone done_delta_ms={delta_ms}")

if "marked_unread" in body:
marked_unread = {"unread": body["marked_unread"], "ts": ts}
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 "read_markers" in body:
await self.read_marker_client.handle_read_marker(
room_id, body["read_markers"], requester
Expand Down

0 comments on commit 560d9f7

Please sign in to comment.