@namespace("chat.1")
protocol gregor {

    record GenericPayload {
        @lint("ignore")
        string Action;
    }

    record NewConversationPayload {
        @lint("ignore")
        string Action;
        ConversationID convID;
        InboxVers inboxVers;
        union { null, UnreadUpdate } unreadUpdate;
    }

    record NewMessagePayload {
        @lint("ignore")
        string Action;
        ConversationID convID;
        MessageBoxed message;
        InboxVers inboxVers;
        union { null, UnreadUpdate } unreadUpdate;
    }

    record ReadMessagePayload {
        @lint("ignore")
        string Action;
        ConversationID convID;
        MessageID msgID;
        InboxVers inboxVers;
        union { null, UnreadUpdate } unreadUpdate;
    }

    record SetStatusPayload {
        @lint("ignore")
        string Action;
        ConversationID convID;
        ConversationStatus status;
        InboxVers inboxVers;
        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
        @lint("ignore")
        int UnreadMessages;
    }

    record TLFFinalizeUpdate {
        ConversationFinalizeInfo finalizeInfo;
        array<ConversationID> convIDs;
        InboxVers inboxVers;
    }

    record TLFResolveUpdate {
        ConversationID convID;
        InboxVers inboxVers;
    }
}
