Introduce Service Id Types

Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
Fedor Indutny 2023-08-10 18:43:33 +02:00 committed by Jamie Kyle
parent 414c0a58d3
commit 366b875fd2
269 changed files with 5832 additions and 5550 deletions

View file

@ -8,7 +8,7 @@ import type {
MessageAttributesType,
QuotedMessageType,
} from '../model-types.d';
import type { UUIDStringType } from '../types/UUID';
import type { ServiceIdString } from '../types/ServiceId';
import { PaymentEventKind } from '../types/Payment';
import type { AnyPaymentEvent } from '../types/Payment';
import type { LocalizerType } from '../types/Util';
@ -193,7 +193,7 @@ export function getSourceDevice(
export function getSourceUuid(
message: Pick<MessageAttributesType, 'type' | 'sourceUuid'>
): UUIDStringType | undefined {
): ServiceIdString | undefined {
if (isIncoming(message) || isStory(message)) {
return message.sourceUuid;
}
@ -203,7 +203,7 @@ export function getSourceUuid(
);
}
return window.textsecure.storage.user.getUuid()?.toString();
return window.textsecure.storage.user.getAci();
}
export const isCustomError = (e: unknown): e is CustomError =>