user_status.proto 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. syntax = "proto3";
  2. package chatto.api.v1;
  3. import "buf/validate/validate.proto";
  4. import "google/protobuf/timestamp.proto";
  5. // Custom status shown on a user profile, separate from presence.
  6. message CustomUserStatus {
  7. // Short emoji marker displayed with the status.
  8. string emoji = 1 [(buf.validate.field).string = {
  9. min_len: 1
  10. max_len: 16
  11. }];
  12. // User-written status text.
  13. string text = 2 [(buf.validate.field).string = {
  14. min_len: 1
  15. max_len: 100
  16. }];
  17. // Optional time after which clients should stop showing the status.
  18. google.protobuf.Timestamp expires_at = 3;
  19. }
  20. // Request to replace the current user's complete custom status. Emoji and text
  21. // are required. Omitted expires_at removes any previous expiry. Use
  22. // DeleteCustomStatus to clear the status.
  23. message SetCustomStatusRequest {
  24. // Short emoji marker displayed with the status.
  25. string emoji = 1;
  26. // User-written status text.
  27. string text = 2;
  28. // Optional future time after which clients should stop showing the status.
  29. google.protobuf.Timestamp expires_at = 3;
  30. }
  31. // Result of setting the current user's complete custom status.
  32. message SetCustomStatusResponse {
  33. // Stored custom status after validation and normalization.
  34. CustomUserStatus status = 1;
  35. }
  36. // Request to delete the current user's custom status.
  37. message DeleteCustomStatusRequest {}
  38. // Result of deleting the current user's custom status.
  39. message DeleteCustomStatusResponse {
  40. // Current custom status after the operation. Usually absent after a clear.
  41. CustomUserStatus status = 1;
  42. }