Call Disposition

This commit is contained in:
Jamie Kyle 2023-01-09 16:52:01 -08:00 committed by GitHub
parent 9927b132b9
commit e5638c0b20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 445 additions and 53 deletions

View file

@ -256,6 +256,7 @@ const dataInterface: ServerInterface = {
getConversationRangeCenteredOnMessage,
getConversationMessageStats,
getLastConversationMessage,
getCallHistoryMessageByCallId,
hasGroupCallHistoryMessage,
migrateConversationMessages,
@ -3009,6 +3010,32 @@ async function getConversationRangeCenteredOnMessage({
})();
}
async function getCallHistoryMessageByCallId(
conversationId: string,
callId: string
): Promise<string | void> {
const db = getInstance();
const id: string | void = db
.prepare<Query>(
`
SELECT id
FROM messages
WHERE conversationId = $conversationId
AND type = 'call-history'
AND callMode = 'Direct'
AND callId = $callId
`
)
.pluck()
.get({
conversationId,
callId,
});
return id;
}
async function hasGroupCallHistoryMessage(
conversationId: string,
eraId: string