Poll notifications and read syncs

This commit is contained in:
yash-signal
2025-11-12 09:26:16 -06:00
committed by GitHub
parent 7a8f208854
commit 7dd865904e
15 changed files with 1185 additions and 87 deletions

View File

@@ -153,6 +153,7 @@ export const MESSAGE_NON_PRIMARY_KEY_COLUMNS = [
'hasAttachments',
'hasFileAttachments',
'hasVisualMediaAttachments',
'hasUnreadPollVotes',
'isChangeCreatedByUs',
'isErased',
'isViewOnce',
@@ -190,6 +191,7 @@ export type MessageTypeUnhydrated = {
hasAttachments: 0 | 1 | null;
hasFileAttachments: 0 | 1 | null;
hasVisualMediaAttachments: 0 | 1 | null;
hasUnreadPollVotes: 0 | 1 | null;
isChangeCreatedByUs: 0 | 1 | null;
isErased: 0 | 1 | null;
isViewOnce: 0 | 1 | null;
@@ -481,6 +483,13 @@ export type ReactionResultType = Pick<
'targetAuthorAci' | 'targetTimestamp' | 'messageId'
> & { rowid: number };
export type PollVoteReadResultType = {
id: string;
conversationId: string;
targetTimestamp: number;
type: MessageType['type'];
};
export type GetUnreadByConversationAndMarkReadResultType = Array<
{ originalReadStatus: ReadStatus | undefined } & Pick<
MessageType,
@@ -1069,10 +1078,17 @@ type WritableInterface = {
readMessageReceivedAt: number;
storyId?: string;
}) => Array<ReactionResultType>;
getUnreadPollVotesAndMarkRead: (options: {
conversationId: string;
readMessageReceivedAt: number;
}) => Array<PollVoteReadResultType>;
markReactionAsRead: (
targetAuthorServiceId: ServiceIdString,
targetTimestamp: number
) => ReactionType | undefined;
markPollVoteAsRead: (
targetTimestamp: number
) => MessageAttributesType | undefined;
removeReactionFromConversation: (reaction: {
emoji: string;
fromId: string;