presence.proto 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. syntax = "proto3";
  2. package chatto.api.v1;
  3. import "buf/validate/validate.proto";
  4. // Live presence status returned by public read APIs.
  5. //
  6. // Offline is a read-side state only. Clients cannot update their presence to
  7. // Offline through the account presence RPC; they should stop refreshing and let
  8. // the server's live presence record expire.
  9. enum PresenceStatus {
  10. // No presence status was specified.
  11. PRESENCE_STATUS_UNSPECIFIED = 0;
  12. // The user is actively available.
  13. PRESENCE_STATUS_ONLINE = 1;
  14. // The user is connected but away or idle.
  15. PRESENCE_STATUS_AWAY = 2;
  16. // The user does not want notifications while this live status is active.
  17. PRESENCE_STATUS_DO_NOT_DISTURB = 3;
  18. // The user has no active live presence record.
  19. PRESENCE_STATUS_OFFLINE = 4;
  20. }
  21. // Request to update the current user's live presence status.
  22. message UpdatePresenceRequest {
  23. // Live status to store for the authenticated user. Offline is rejected.
  24. PresenceStatus status = 1 [(buf.validate.field).enum = {
  25. defined_only: true
  26. not_in: [0, 4]
  27. }];
  28. // True when this update comes from a deliberate user selection rather than
  29. // automatic idle/refresh updates. Automatic updates do not overwrite an
  30. // active manually selected Away or Do Not Disturb status from another client.
  31. bool user_selected = 2;
  32. }
  33. // Result of updating live presence.
  34. message UpdatePresenceResponse {
  35. // Reportable status accepted and stored by the server.
  36. PresenceStatus status = 1;
  37. }