Introduce new 'Block request' button in timeline

This commit is contained in:
Scott Nonnenberg 2022-03-15 17:11:28 -07:00 committed by GitHub
parent 536dd0c7b0
commit 703bb8a3a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 1088 additions and 157 deletions

View file

@ -56,7 +56,7 @@ import type {
IdentityKeyType,
ItemKeyType,
ItemType,
LastConversationMessagesType,
ConversationMessageStatsType,
MessageType,
MessageTypeUnhydrated,
PreKeyIdType,
@ -241,7 +241,8 @@ const dataInterface: ClientInterface = {
getNewerMessagesByConversation,
getMessageMetricsForConversation,
getConversationRangeCenteredOnMessage,
getLastConversationMessages,
getConversationMessageStats,
getLastConversationMessage,
hasGroupCallHistoryMessage,
migrateConversationMessages,
@ -1097,7 +1098,7 @@ async function saveMessage(
}
async function saveMessages(
arrayOfMessages: Array<MessageType>,
arrayOfMessages: ReadonlyArray<MessageType>,
options: { forceSave?: boolean; ourUuid: UUIDStringType }
) {
await channels.saveMessages(
@ -1291,15 +1292,15 @@ async function getNewerMessagesByConversation(
return handleMessageJSON(messages);
}
async function getLastConversationMessages({
async function getConversationMessageStats({
conversationId,
ourUuid,
}: {
conversationId: string;
ourUuid: UUIDStringType;
}): Promise<LastConversationMessagesType> {
}): Promise<ConversationMessageStatsType> {
const { preview, activity, hasUserInitiatedMessages } =
await channels.getLastConversationMessages({
await channels.getConversationMessageStats({
conversationId,
ourUuid,
});
@ -1310,6 +1311,13 @@ async function getLastConversationMessages({
hasUserInitiatedMessages,
};
}
async function getLastConversationMessage({
conversationId,
}: {
conversationId: string;
}) {
return channels.getLastConversationMessage({ conversationId });
}
async function getMessageMetricsForConversation(
conversationId: string,
storyId?: UUIDStringType