Update call history timestamps from group call update messages

This commit is contained in:
Jamie Kyle 2023-09-28 13:55:23 -07:00 committed by GitHub
parent 72d1695612
commit 66a4a8690a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 191 additions and 118 deletions

View file

@ -186,7 +186,10 @@ import {
getCallsHistoryForRedux,
loadCallsHistory,
} from './services/callHistoryLoader';
import { getCallIdFromEra } from './util/callDisposition';
import {
getCallIdFromEra,
updateLocalGroupCallHistoryTimestamp,
} from './util/callDisposition';
export function isOverHourIntoPast(timestamp: number): boolean {
return isNumber(timestamp) && isOlderThan(timestamp, HOUR);
@ -2908,16 +2911,29 @@ export async function startApp(): Promise<void> {
): boolean {
if (message.groupCallUpdate) {
if (message.groupV2 && messageDescriptor.type === Message.GROUP) {
const conversationId = messageDescriptor.id;
const callId =
message.groupCallUpdate?.eraId != null
? getCallIdFromEra(message.groupCallUpdate.eraId)
: null;
log.info(
'handleGroupCallUpdateMessage',
message.timestamp,
message.groupCallUpdate?.eraId != null
? getCallIdFromEra(message.groupCallUpdate.eraId)
: null
callId,
conversationId
);
window.reduxActions.calling.peekNotConnectedGroupCall({
conversationId: messageDescriptor.id,
conversationId,
});
if (callId != null) {
drop(
updateLocalGroupCallHistoryTimestamp(
conversationId,
callId,
message.timestamp
)
);
}
return true;
}
log.warn(