@namespace("chat.1") protocol gregor { import idl "../gregor1" as gregor1; import idl "../keybase1" as keybase1; record GenericPayload { @lint("ignore") string Action; InboxVers inboxVers; ConversationID convID; TopicType topicType; union { null, UnreadUpdate } unreadUpdate; } record NewConversationPayload { @lint("ignore") string Action; ConversationID convID; InboxVers inboxVers; TopicType topicType; union { null, UnreadUpdate } unreadUpdate; } record NewMessagePayload { @lint("ignore") string Action; ConversationID convID; MessageBoxed message; InboxVers inboxVers; TopicType topicType; union { null, UnreadUpdate } unreadUpdate; keybase1.TeamRole untrustedTeamRole; // Optionally the server can send down the new set of max messages array maxMsgs; } record ReadMessagePayload { @lint("ignore") string Action; ConversationID convID; MessageID msgID; InboxVers inboxVers; TopicType topicType; union { null, UnreadUpdate } unreadUpdate; } record SetStatusPayload { @lint("ignore") string Action; ConversationID convID; ConversationStatus status; InboxVers inboxVers; TopicType topicType; union { null, UnreadUpdate } unreadUpdate; } record TeamTypePayload { @lint("ignore") string Action; ConversationID convID; TeamType teamType; InboxVers inboxVers; TopicType topicType; union { null, UnreadUpdate } unreadUpdate; } record SetAppNotificationSettingsPayload { @lint("ignore") string Action; ConversationID convID; InboxVers inboxVers; ConversationNotificationInfo settings; TopicType topicType; union { null, UnreadUpdate } unreadUpdate; } record ExpungePayload { @lint("ignore") string Action; ConversationID convID; InboxVers inboxVers; Expunge expunge; array maxMsgs; TopicType topicType; union { null, UnreadUpdate } unreadUpdate; } record UnreadUpdate { ConversationID convID; // The count of unread messages to display // Counts only visible types of messages deserving of a badge, no EDITs int unreadMessages; map unreadNotifyingMessages; // Compatibility field for gregor->client messages. Result of past botched protocol change. @mpackkey("UnreadMessages") @jsonkey("UnreadMessages") int compatUnreadMessages; boolean diff; } record TLFFinalizeUpdate { ConversationFinalizeInfo finalizeInfo; array convIDs; InboxVers inboxVers; } record TLFResolveUpdate { ConversationID convID; InboxVers inboxVers; } record RemoteUserTypingUpdate { gregor1.UID uid; gregor1.DeviceID deviceID; ConversationID convID; boolean typing; @mpackkey("t") TeamType teamType; } record TeamMemberRoleUpdate { TLFID tlfID; keybase1.TeamRole role; } record UpdateConversationMembership { InboxVers inboxVers; union { null, TeamMemberRoleUpdate } teamMemberRoleUpdate; array joined; array removed; array reset; array previewed; // only IDs the user receiving the message has previews are in here union { null, UnreadUpdate } unreadUpdate; array unreadUpdates; } record ConversationUpdate { ConversationID convID; ConversationExistence existence; } record UpdateConversations { InboxVers inboxVers; array convUpdates; } record SetConvRetentionUpdate { InboxVers inboxVers; ConversationID convID; RetentionPolicy policy; } record SetTeamRetentionUpdate { InboxVers inboxVers; keybase1.TeamID teamID; RetentionPolicy policy; } record SetConvSettingsUpdate { InboxVers inboxVers; ConversationID convID; union { null, ConversationSettings } convSettings; } record KBFSImpteamUpgradeUpdate { ConversationID convID; InboxVers inboxVers; TopicType topicType; } record SubteamRenameUpdate { array convIDs; InboxVers inboxVers; } }