Message Requests improvements
This commit is contained in:
parent
b63291507a
commit
81cb7730a5
21 changed files with 302 additions and 263 deletions
|
@ -156,6 +156,8 @@ const dataInterface: ClientInterface = {
|
|||
getTapToViewMessagesNeedingErase,
|
||||
getOlderMessagesByConversation,
|
||||
getNewerMessagesByConversation,
|
||||
getLastConversationActivity,
|
||||
getLastConversationPreview,
|
||||
getMessageMetricsForConversation,
|
||||
migrateConversationMessages,
|
||||
|
||||
|
@ -1022,6 +1024,32 @@ async function getNewerMessagesByConversation(
|
|||
|
||||
return new MessageCollection(handleMessageJSON(messages));
|
||||
}
|
||||
async function getLastConversationActivity(
|
||||
conversationId: string,
|
||||
options: {
|
||||
Message: typeof MessageModelType;
|
||||
}
|
||||
): Promise<MessageModelType | undefined> {
|
||||
const { Message } = options;
|
||||
const result = await channels.getLastConversationActivity(conversationId);
|
||||
if (result) {
|
||||
return new Message(result);
|
||||
}
|
||||
return;
|
||||
}
|
||||
async function getLastConversationPreview(
|
||||
conversationId: string,
|
||||
options: {
|
||||
Message: typeof MessageModelType;
|
||||
}
|
||||
): Promise<MessageModelType | undefined> {
|
||||
const { Message } = options;
|
||||
const result = await channels.getLastConversationPreview(conversationId);
|
||||
if (result) {
|
||||
return new Message(result);
|
||||
}
|
||||
return;
|
||||
}
|
||||
async function getMessageMetricsForConversation(conversationId: string) {
|
||||
const result = await channels.getMessageMetricsForConversation(
|
||||
conversationId
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue