nextspace
    Preparing search index...

    Interface UseMessageModerationParams

    Parameters required for the useMessageModeration hook.

    interface UseMessageModerationParams {
        chatMessages: PseudonymousMessage[];
        conversationId: string | undefined;
        isAdmin: boolean;
        pendingHiddenRef: MutableRefObject<Map<string, boolean>>;
        setAssistantMessages: Dispatch<SetStateAction<PseudonymousMessage[]>>;
        setChatMessages: Dispatch<SetStateAction<PseudonymousMessage[]>>;
        socket: Socket<DefaultEventsMap, DefaultEventsMap> | null;
        userId: string | null;
    }
    Index

    Properties

    chatMessages: PseudonymousMessage[]

    The group chat messages, used to find everything one author posted.

    conversationId: string | undefined

    The conversation whose group chat is being moderated.

    isAdmin: boolean

    Whether the reader holds the admin role. False for guests and when the account could not be read.

    pendingHiddenRef: MutableRefObject<Map<string, boolean>>

    Optimistic verdicts still waiting on the server, by message id. The same ref goes to useConversationMessages so a fetch that lands in the meantime keeps them; it has to be created by the caller because that hook supplies the setters this one needs.

    setAssistantMessages: Dispatch<SetStateAction<PseudonymousMessage[]>>

    Private assistant messages also receive message:hidden, since the event carries ids only.

    setChatMessages: Dispatch<SetStateAction<PseudonymousMessage[]>>
    socket: Socket<DefaultEventsMap, DefaultEventsMap> | null

    The live socket, or null before it connects.

    userId: string | null

    The reader's account id. A hidden author keeps seeing their own messages.