reactions.proto 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. syntax = "proto3";
  2. package chatto.api.v1;
  3. import "buf/validate/validate.proto";
  4. import "chatto/api/v1/message_types.proto";
  5. // Request to add the current user's reaction to a message.
  6. //
  7. // When `message_event_id` names a channel echo of a thread reply, the server
  8. // treats it as an alias for the original thread reply and stores the reaction
  9. // on that original event.
  10. message AddReactionRequest {
  11. // Required. Room containing the message event.
  12. string room_id = 1 [(buf.validate.field).string.min_len = 1];
  13. // Required. Event ID of the message being reacted to, or a channel echo of
  14. // the message.
  15. string message_event_id = 2 [(buf.validate.field).string.min_len = 1];
  16. // Required. Emoji shortcode name, such as "thumbsup" or "heart".
  17. string emoji = 3 [(buf.validate.field).string.min_len = 1];
  18. }
  19. // Result of adding a reaction.
  20. message AddReactionResponse {
  21. // True when the reaction was newly added, false when it already existed.
  22. bool added = 1;
  23. // Updated aggregate reaction state for this emoji.
  24. MessageReaction reaction = 2;
  25. }
  26. // Request to remove the current user's reaction from a message.
  27. //
  28. // When `message_event_id` names a channel echo of a thread reply, the server
  29. // treats it as an alias for the original thread reply and removes the reaction
  30. // from that original event.
  31. message RemoveReactionRequest {
  32. // Required. Room containing the message event.
  33. string room_id = 1 [(buf.validate.field).string.min_len = 1];
  34. // Required. Event ID of the message whose reaction should be removed, or a
  35. // channel echo of the message.
  36. string message_event_id = 2 [(buf.validate.field).string.min_len = 1];
  37. // Required. Emoji shortcode name, such as "thumbsup" or "heart".
  38. string emoji = 3 [(buf.validate.field).string.min_len = 1];
  39. }
  40. // Result of removing a reaction.
  41. message RemoveReactionResponse {
  42. // True when the reaction was removed, false when it did not exist.
  43. bool removed = 1;
  44. // Updated aggregate reaction state for this emoji. Empty when no reactions for
  45. // the emoji remain.
  46. MessageReaction reaction = 2;
  47. }