read_state.proto 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. syntax = "proto3";
  2. package chatto.api.v1;
  3. import "buf/validate/validate.proto";
  4. import "google/protobuf/timestamp.proto";
  5. // Request to mark a room timeline as read.
  6. message MarkRoomAsReadRequest {
  7. // Required. Room whose timeline should be marked read.
  8. string room_id = 1 [(buf.validate.field).string.min_len = 1];
  9. // Highest room event ID the current user has read. When set, the event must
  10. // exist as a root event in the room timeline. Leave empty to mark through the
  11. // room's current latest root event.
  12. string up_to_event_id = 2;
  13. }
  14. // Result of marking a room timeline as read.
  15. //
  16. // Clients can use the previous timestamp to decide whether unread badges or
  17. // local notification state need to be reconciled.
  18. message MarkRoomAsReadResponse {
  19. // New room read timestamp stored for the current user.
  20. google.protobuf.Timestamp last_read_at = 1;
  21. // Previous room read timestamp, when one existed.
  22. google.protobuf.Timestamp previous_last_read_at = 2;
  23. }
  24. // Request to mark a message thread as read.
  25. message MarkThreadAsReadRequest {
  26. // Required. Room containing the thread.
  27. string room_id = 1 [(buf.validate.field).string.min_len = 1];
  28. // Required. Event ID of the root message for the thread.
  29. string thread_root_event_id = 2 [(buf.validate.field).string.min_len = 1];
  30. // Highest thread event ID the current user has read. The event should belong
  31. // to the thread identified by thread_root_event_id.
  32. string up_to_event_id = 3;
  33. }
  34. // Result of marking a message thread as read.
  35. message MarkThreadAsReadResponse {
  36. // Previous thread read timestamp, when one existed.
  37. google.protobuf.Timestamp previous_read_at = 1;
  38. }