events.proto 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  1. syntax = "proto3";
  2. package chatto.realtime.v1;
  3. // A public role was created. Read its current metadata with RoleService.
  4. message RoleCreatedEvent {
  5. // Stable role name.
  6. string role_name = 1;
  7. }
  8. // Public role metadata changed. Read its current metadata with RoleService.
  9. // This event does not change permission decisions.
  10. message RoleUpdatedEvent {
  11. // Stable role name.
  12. string role_name = 1;
  13. }
  14. // A role was deleted. Remove it from role catalogues and member role lists.
  15. // Clients retaining this role for their viewer must discard private cached
  16. // data and load current authorized state before displaying it again.
  17. message RoleDeletedEvent {
  18. // Stable name of the deleted role.
  19. string role_name = 1;
  20. }
  21. // Custom roles changed display order. Permission decisions are unchanged.
  22. message RolesReorderedEvent {
  23. // Custom role names in ascending display position.
  24. repeated string role_names = 1;
  25. }
  26. // A user was assigned a role. The named user's clients must discard private
  27. // cached data and load current authorized state. Other viewers update member
  28. // role lists without a full reload.
  29. message RoleAssignedEvent {
  30. // User whose assignment changed.
  31. string user_id = 1;
  32. // Stable role name.
  33. string role_name = 2;
  34. }
  35. // A user's role assignment was removed. The named user's clients must discard
  36. // private cached data and load current authorized state.
  37. message RoleRevokedEvent {
  38. // User whose assignment changed.
  39. string user_id = 1;
  40. // Stable role name.
  41. string role_name = 2;
  42. }
  43. // A role's permission decisions changed. Clients whose viewer has this role
  44. // must discard private cached data and load current authorized state. The
  45. // implicit everyone role applies to every viewer. Private scopes and permission
  46. // decisions are not included. Read current decisions through authorized APIs.
  47. message RolePermissionsChangedEvent {
  48. // Stable role name.
  49. string role_name = 1;
  50. }
  51. // The authenticated viewer's permission decisions may have changed. This also
  52. // covers changes to a bot's owner permission ceiling. Delivered only to the
  53. // affected viewer. Discard private cached data and load current authorized
  54. // state before displaying it again. The connection itself remains open.
  55. message ViewerPermissionsChangedEvent {}
  56. import "chatto/api/v1/common.proto";
  57. import "chatto/api/v1/presence.proto";
  58. import "chatto/api/v1/rooms.proto";
  59. // RoomCreatedEvent reports a new room that is visible to the caller.
  60. message RoomCreatedEvent {
  61. string room_id = 1;
  62. string name = 2;
  63. string description = 3;
  64. chatto.api.v1.RoomKind kind = 4;
  65. bool universal = 5;
  66. chatto.api.v1.RoomThreadingMode threading_mode = 6;
  67. }
  68. // RoomUpdatedEvent reports changed room metadata.
  69. message RoomUpdatedEvent {
  70. string room_id = 1;
  71. string name = 2;
  72. string description = 3;
  73. }
  74. // RoomDeletedEvent reports a deleted room.
  75. message RoomDeletedEvent {
  76. string room_id = 1;
  77. }
  78. // RoomArchivedEvent reports a room that became archived.
  79. message RoomArchivedEvent {
  80. string room_id = 1;
  81. }
  82. // RoomUnarchivedEvent reports a room that became active again.
  83. message RoomUnarchivedEvent {
  84. string room_id = 1;
  85. }
  86. // RoomUniversalChangedEvent reports the current universal-membership setting.
  87. message RoomUniversalChangedEvent {
  88. string room_id = 1;
  89. bool universal = 2;
  90. }
  91. // RoomSlowModeChangedEvent reports the current slow-mode interval.
  92. message RoomSlowModeChangedEvent {
  93. string room_id = 1;
  94. uint32 slow_mode_seconds = 2;
  95. }
  96. // RoomThreadingModeChangedEvent reports the current room threading policy.
  97. message RoomThreadingModeChangedEvent {
  98. string room_id = 1;
  99. chatto.api.v1.RoomThreadingMode threading_mode = 2;
  100. }
  101. // UserJoinedRoomEvent reports that the actor joined a room.
  102. message UserJoinedRoomEvent {
  103. string room_id = 1;
  104. }
  105. // UserLeftRoomEvent reports that the actor left a room.
  106. message UserLeftRoomEvent {
  107. string room_id = 1;
  108. }
  109. // VoiceCallParticipantJoinedEvent reports that the actor joined a call session.
  110. message VoiceCallParticipantJoinedEvent {
  111. string room_id = 1;
  112. string call_id = 2;
  113. }
  114. // VoiceCallParticipantLeftEvent reports that the actor left a call session.
  115. message VoiceCallParticipantLeftEvent {
  116. string room_id = 1;
  117. string call_id = 2;
  118. }
  119. // VoiceCallStartedEvent reports a new call session.
  120. message VoiceCallStartedEvent {
  121. string room_id = 1;
  122. string call_id = 2;
  123. }
  124. // VoiceCallEndedEvent reports the end of a call session.
  125. message VoiceCallEndedEvent {
  126. string room_id = 1;
  127. string call_id = 2;
  128. }
  129. // MessagePostedEvent reports a new room message.
  130. message MessagePostedEvent {
  131. string room_id = 1;
  132. string in_reply_to = 2;
  133. // Root message ID for a thread reply. Empty for a room-level message.
  134. string thread_root_event_id = 3;
  135. reserved 4;
  136. reserved "mentioned_user_ids";
  137. string echo_of_event_id = 5;
  138. string echo_from_thread_root_event_id = 6;
  139. // Distinct mention targets, without expanded role or broadcast recipients.
  140. repeated MessageMention mentions = 7;
  141. // Plaintext message text. The field is absent after key shredding.
  142. optional string body_plaintext = 8;
  143. // Immutable room kind. Direct messages do not require a mention to address a bot.
  144. chatto.api.v1.RoomKind room_kind = 9;
  145. }
  146. // DirectUserMention identifies a direct user mention.
  147. message DirectUserMention {
  148. string user_id = 1;
  149. }
  150. // RoleMessageMention identifies the role that caused a mention.
  151. message RoleMessageMention {
  152. string role_name = 1;
  153. }
  154. // HereMessageMention identifies a presence-scoped mention.
  155. message HereMessageMention {}
  156. // AllMessageMention identifies a room-wide mention.
  157. message AllMessageMention {}
  158. // MessageMention identifies one distinct mention target. Role, here, and all
  159. // targets occur once, regardless of the number of recipients. Targets with no
  160. // resolved recipients are omitted. Recipient decisions are from message creation,
  161. // including during replay; clients must not infer them from current membership.
  162. message MessageMention {
  163. reserved 1;
  164. reserved "user_id";
  165. oneof cause {
  166. DirectUserMention direct = 2;
  167. RoleMessageMention role = 3;
  168. HereMessageMention here = 4;
  169. AllMessageMention all = 5;
  170. }
  171. // True if this target included the authenticated caller when the message was posted.
  172. bool includes_viewer = 6;
  173. }
  174. // MessageEditedEvent reports changed message content or metadata.
  175. message MessageEditedEvent {
  176. string room_id = 1;
  177. string message_event_id = 2;
  178. }
  179. // MessageRetractedEvent reports a retracted message.
  180. message MessageRetractedEvent {
  181. string room_id = 1;
  182. string message_event_id = 2;
  183. }
  184. // MessagePinnedEvent reports a newly pinned message.
  185. message MessagePinnedEvent {
  186. string room_id = 1;
  187. string message_event_id = 2;
  188. }
  189. // MessageUnpinnedEvent reports a message that is no longer pinned.
  190. message MessageUnpinnedEvent {
  191. string room_id = 1;
  192. string message_event_id = 2;
  193. }
  194. // ThreadCreatedEvent reports a new message thread.
  195. message ThreadCreatedEvent {
  196. string room_id = 1;
  197. string thread_root_event_id = 2;
  198. }
  199. // AssetProcessingStartedEvent reports that message-asset processing started.
  200. message AssetProcessingStartedEvent {
  201. string asset_id = 1;
  202. string message_event_id = 2;
  203. // Room containing the affected message.
  204. string room_id = 3;
  205. }
  206. // AssetProcessingSucceededEvent reports successful message-asset processing.
  207. // Read the message resource for current attachments and processed video data.
  208. message AssetProcessingSucceededEvent {
  209. string asset_id = 1;
  210. reserved 2;
  211. reserved "video";
  212. string message_event_id = 3;
  213. // Room containing the affected message.
  214. string room_id = 4;
  215. }
  216. // AssetProcessingFailureCode identifies a stable processing failure class.
  217. enum AssetProcessingFailureCode {
  218. // The failure class is not known.
  219. ASSET_PROCESSING_FAILURE_CODE_UNSPECIFIED = 0;
  220. // Asset processing failed without a more specific public reason.
  221. ASSET_PROCESSING_FAILURE_CODE_PROCESSING_FAILED = 1;
  222. // The source asset was not available.
  223. ASSET_PROCESSING_FAILURE_CODE_SOURCE_MISSING = 2;
  224. }
  225. // AssetProcessingFailedEvent reports failed message-asset processing.
  226. message AssetProcessingFailedEvent {
  227. string asset_id = 1;
  228. AssetProcessingFailureCode failure_code = 2;
  229. string message_event_id = 3;
  230. // Room containing the affected message.
  231. string room_id = 4;
  232. }
  233. // AssetDeletedEvent reports a deleted asset.
  234. message AssetDeletedEvent {
  235. string asset_id = 1;
  236. // Room containing the affected message.
  237. string room_id = 2;
  238. // Message that owns the asset, including a deleted derivative asset.
  239. string message_event_id = 3;
  240. }
  241. // ServerMotdChangedEvent reports the current message of the day.
  242. message ServerMotdChangedEvent {
  243. string motd = 1;
  244. }
  245. // UserAccountCreatedEvent reports a new public user account.
  246. message UserAccountCreatedEvent {
  247. string user_id = 1;
  248. bool is_bot = 2;
  249. }
  250. // UserAccountDeletedEvent reports a deleted user account.
  251. message UserAccountDeletedEvent {
  252. string user_id = 1;
  253. }
  254. // ReactionAddedEvent reports a new message reaction.
  255. message ReactionAddedEvent {
  256. string room_id = 1;
  257. string message_event_id = 2;
  258. string emoji = 3;
  259. }
  260. // ReactionRemovedEvent reports a removed message reaction.
  261. message ReactionRemovedEvent {
  262. string room_id = 1;
  263. string message_event_id = 2;
  264. string emoji = 3;
  265. }
  266. // RoomLayoutChangedEvent reports a change to room groups, their entries, or order.
  267. // Refresh RoomDirectoryService.ListRoomGroups with this event's cursor as the
  268. // minimum boundary. The event contains no room IDs or other hidden layout data.
  269. message RoomLayoutChangedEvent {}
  270. // UserProfileChangedEvent reports that the current public user resource changed.
  271. // Read the user through UserService with this event's resume cursor as the
  272. // minimum boundary.
  273. message UserProfileChangedEvent {
  274. string user_id = 1;
  275. }
  276. // ViewerPreferencesChangedEvent reports that the caller's private user
  277. // preferences changed. Read ViewerService with this event's resume cursor as
  278. // the minimum boundary.
  279. message ViewerPreferencesChangedEvent {}
  280. // ThreadViewerStateChangedEvent reports the caller's current thread state.
  281. message ThreadViewerStateChangedEvent {
  282. string room_id = 1;
  283. string thread_root_event_id = 2;
  284. bool is_following = 3;
  285. }
  286. // ServerProfileChangedEvent reports that the public server profile changed.
  287. // Read ServerService with this event's resume cursor as the minimum boundary.
  288. message ServerProfileChangedEvent {}
  289. // UserTypingEvent reports current typing activity for the event actor.
  290. // Track each actor separately for each room and thread. Clear the indicator
  291. // 6 seconds after the last received typing event, or when that actor posts
  292. // a message in the same room or thread. No stop-typing event is sent.
  293. message UserTypingEvent {
  294. string room_id = 1;
  295. optional string thread_root_event_id = 2;
  296. }
  297. // PresenceChangedEvent reports the actor's current presence.
  298. message PresenceChangedEvent {
  299. chatto.api.v1.PresenceStatus status = 1;
  300. }
  301. // Delivered only to the account whose private availability choice changed.
  302. // Refetch MyAccountService.GetPresencePreference to obtain the current choice.
  303. message ViewerPresencePreferenceChangedEvent {}
  304. // NotificationOccurrencesChangedEvent reports that the caller's current
  305. // notification occurrences changed and requests an authoritative resource read.
  306. message NotificationOccurrencesChangedEvent {
  307. // ID of a newly created notification, including read notifications and
  308. // creations during Do Not Disturb. Absent for updates and removals.
  309. // This is a best-effort live hint, not a sound instruction or durable delivery.
  310. // Clients decide whether to alert after they read current notification state.
  311. optional string created_notification_id = 1;
  312. }
  313. // NotificationUnreadStateChangedEvent reports that the caller's notification
  314. // unread state changed and requests authoritative notification and room reads.
  315. message NotificationUnreadStateChangedEvent {
  316. string room_id = 1;
  317. // Event ID of the affected thread root, or empty for room state.
  318. string thread_root_event_id = 2;
  319. }
  320. // RoomReadStateChangedEvent reports the caller's current room read state.
  321. message RoomReadStateChangedEvent {
  322. string room_id = 1;
  323. }