Update to the latest SignalService.proto

This commit is contained in:
Scott Nonnenberg
2025-02-11 08:20:14 +10:00
committed by GitHub
parent cf5dc4b940
commit d26d915a44
26 changed files with 464 additions and 536 deletions

View File

@@ -12,7 +12,6 @@ import { MessageModel } from '../models/messages';
export type ViewOnceOpenSyncAttributesType = {
removeFromMessageReceiverCache: () => unknown;
source?: string;
sourceAci: AciString;
timestamp: number;
};
@@ -46,15 +45,6 @@ export function forMessage(
return syncBySourceServiceId;
}
const syncBySource = viewOnceSyncValues.find(item => {
return item.source === message.source && item.timestamp === message.sent_at;
});
if (syncBySource) {
log.info(`${logId}: Found early view once open sync for message`);
remove(syncBySource);
return syncBySource;
}
return null;
}
@@ -69,23 +59,16 @@ export async function onSync(
const messages = await DataReader.getMessagesBySentAt(sync.timestamp);
const found = messages.find(item => {
const itemSourceAci = item.sourceServiceId;
const syncSourceAci = sync.sourceAci;
const itemSource = item.source;
const syncSource = sync.source;
const itemSource = item.sourceServiceId;
const syncSource = sync.sourceAci;
return Boolean(
(itemSourceAci && syncSourceAci && itemSourceAci === syncSourceAci) ||
(itemSource && syncSource && itemSource === syncSource)
);
return Boolean(itemSource && syncSource && itemSource === syncSource);
});
const syncSource = sync.source;
const syncSourceAci = sync.sourceAci;
const syncTimestamp = sync.timestamp;
const wasMessageFound = Boolean(found);
log.info(`${logId} receive:`, {
syncSource,
syncSourceAci,
syncTimestamp,
wasMessageFound,