MCPcopy
hub / github.com/signalapp/Signal-Desktop / processPinMessage

Function processPinMessage

ts/textsecure/processDataMessage.preload.ts:355–386  ·  view source on GitHub ↗
(
  pinMessage?: Proto.DataMessage.PinMessage | null
)

Source from the content-addressed store, hash-verified

353}
354
355function processPinMessage(
356 pinMessage?: Proto.DataMessage.PinMessage | null
357): ProcessedPinMessage | undefined {
358 if (pinMessage == null) {
359 return undefined;
360 }
361
362 const targetSentTimestamp = toNumber(pinMessage.targetSentTimestamp);
363 strictAssert(targetSentTimestamp, 'Missing targetSentTimestamp');
364
365 const targetAuthorAci = fromAciUuidBytes(pinMessage.targetAuthorAciBinary);
366 strictAssert(targetAuthorAci, 'Missing targetAuthorAciBinary');
367
368 let pinDuration: DurationInSeconds | null;
369 if (pinMessage.pinDuration?.pinDurationForever) {
370 pinDuration = null;
371 } else {
372 strictAssert(
373 pinMessage.pinDuration?.pinDurationSeconds,
374 'Missing pinDurationSeconds'
375 );
376 pinDuration = DurationInSeconds.fromSeconds(
377 pinMessage.pinDuration.pinDurationSeconds
378 );
379 }
380
381 return {
382 targetSentTimestamp,
383 targetAuthorAci,
384 pinDuration,
385 };
386}
387
388function processPollCreate(
389 pollCreate?: Proto.DataMessage.PollCreate | null

Callers 1

processDataMessageFunction · 0.85

Calls 3

toNumberFunction · 0.90
strictAssertFunction · 0.90
fromAciUuidBytesFunction · 0.90

Tested by

no test coverage detected