Upgrade Prettier to 2.4.1
This commit is contained in:
parent
f204784afe
commit
5619eeca83
176 changed files with 1961 additions and 2465 deletions
|
@ -108,9 +108,8 @@ export default class AccountManager extends EventTarget {
|
|||
|
||||
async decryptDeviceName(base64: string) {
|
||||
const ourUuid = window.textsecure.storage.user.getCheckedUuid();
|
||||
const identityKey = await window.textsecure.storage.protocol.getIdentityKeyPair(
|
||||
ourUuid
|
||||
);
|
||||
const identityKey =
|
||||
await window.textsecure.storage.protocol.getIdentityKeyPair(ourUuid);
|
||||
if (!identityKey) {
|
||||
throw new Error('decryptDeviceName: No identity key pair!');
|
||||
}
|
||||
|
@ -128,7 +127,8 @@ export default class AccountManager extends EventTarget {
|
|||
}
|
||||
|
||||
async maybeUpdateDeviceName() {
|
||||
const isNameEncrypted = window.textsecure.storage.user.getDeviceNameEncrypted();
|
||||
const isNameEncrypted =
|
||||
window.textsecure.storage.user.getDeviceNameEncrypted();
|
||||
if (isNameEncrypted) {
|
||||
return;
|
||||
}
|
||||
|
@ -600,9 +600,8 @@ export default class AccountManager extends EventTarget {
|
|||
|
||||
await storage.put('read-receipt-setting', Boolean(readReceipts));
|
||||
|
||||
const regionCode = window.libphonenumber.util.getRegionCodeForNumber(
|
||||
number
|
||||
);
|
||||
const regionCode =
|
||||
window.libphonenumber.util.getRegionCodeForNumber(number);
|
||||
await storage.put('regionCode', regionCode);
|
||||
await storage.protocol.hydrateCaches();
|
||||
}
|
||||
|
|
|
@ -5,21 +5,17 @@ import type { UUID } from '../types/UUID';
|
|||
import type { SignalProtocolStore } from '../SignalProtocolStore';
|
||||
|
||||
export function init(signalProtocolStore: SignalProtocolStore): void {
|
||||
signalProtocolStore.on(
|
||||
'keychange',
|
||||
async (uuid: UUID): Promise<void> => {
|
||||
const conversation = await window.ConversationController.getOrCreateAndWait(
|
||||
uuid.toString(),
|
||||
'private'
|
||||
);
|
||||
conversation.addKeyChange(uuid);
|
||||
signalProtocolStore.on('keychange', async (uuid: UUID): Promise<void> => {
|
||||
const conversation = await window.ConversationController.getOrCreateAndWait(
|
||||
uuid.toString(),
|
||||
'private'
|
||||
);
|
||||
conversation.addKeyChange(uuid);
|
||||
|
||||
const groups = await window.ConversationController.getAllGroupsInvolvingUuid(
|
||||
uuid
|
||||
);
|
||||
for (const group of groups) {
|
||||
group.addKeyChange(uuid);
|
||||
}
|
||||
const groups =
|
||||
await window.ConversationController.getAllGroupsInvolvingUuid(uuid);
|
||||
for (const group of groups) {
|
||||
group.addKeyChange(uuid);
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -155,7 +155,8 @@ export type MessageReceiverOptions = {
|
|||
|
||||
export default class MessageReceiver
|
||||
extends EventTarget
|
||||
implements IRequestHandler {
|
||||
implements IRequestHandler
|
||||
{
|
||||
private server: WebAPIType;
|
||||
|
||||
private storage: Storage;
|
||||
|
@ -1855,9 +1856,10 @@ export default class MessageReceiver
|
|||
}
|
||||
|
||||
const sender = ProtocolAddress.new(identifier, sourceDevice);
|
||||
const senderKeyDistributionMessage = SenderKeyDistributionMessage.deserialize(
|
||||
Buffer.from(distributionMessage)
|
||||
);
|
||||
const senderKeyDistributionMessage =
|
||||
SenderKeyDistributionMessage.deserialize(
|
||||
Buffer.from(distributionMessage)
|
||||
);
|
||||
const ourUuid = this.storage.user.getCheckedUuid();
|
||||
const senderKeyStore = new SenderKeys({ ourUuid });
|
||||
const address = new QualifiedAddress(
|
||||
|
|
|
@ -430,7 +430,8 @@ export default class OutgoingMessage {
|
|||
);
|
||||
}
|
||||
|
||||
const destinationRegistrationId = activeSession.remoteRegistrationId();
|
||||
const destinationRegistrationId =
|
||||
activeSession.remoteRegistrationId();
|
||||
|
||||
if (sealedSender && senderCertificate) {
|
||||
const ciphertextMessage = await this.getCiphertextMessage({
|
||||
|
@ -673,9 +674,8 @@ export default class OutgoingMessage {
|
|||
messaging: window.textsecure.messaging,
|
||||
});
|
||||
|
||||
const uuid = window.ConversationController.get(identifier)?.get(
|
||||
'uuid'
|
||||
);
|
||||
const uuid =
|
||||
window.ConversationController.get(identifier)?.get('uuid');
|
||||
if (!uuid) {
|
||||
throw new UnregisteredUserError(
|
||||
identifier,
|
||||
|
|
|
@ -1090,7 +1090,8 @@ export default class MessageSender {
|
|||
if (!isEmpty(conversationIdsSentTo)) {
|
||||
sentMessage.unidentifiedStatus = [
|
||||
...map(conversationIdsSentTo, conversationId => {
|
||||
const status = new Proto.SyncMessage.Sent.UnidentifiedDeliveryStatus();
|
||||
const status =
|
||||
new Proto.SyncMessage.Sent.UnidentifiedDeliveryStatus();
|
||||
const conv = window.ConversationController.get(conversationId);
|
||||
if (conv) {
|
||||
const e164 = conv.get('e164');
|
||||
|
@ -1102,9 +1103,8 @@ export default class MessageSender {
|
|||
status.destinationUuid = uuid;
|
||||
}
|
||||
}
|
||||
status.unidentified = conversationIdsWithSealedSender.has(
|
||||
conversationId
|
||||
);
|
||||
status.unidentified =
|
||||
conversationIdsWithSealedSender.has(conversationId);
|
||||
return status;
|
||||
}),
|
||||
];
|
||||
|
@ -1907,10 +1907,10 @@ export default class MessageSender {
|
|||
`sendSenderKeyDistributionMessage: Sending ${distributionId} with timestamp ${timestamp}`
|
||||
);
|
||||
|
||||
const senderKeyDistributionMessage = await this.getSenderKeyDistributionMessage(
|
||||
distributionId
|
||||
);
|
||||
contentMessage.senderKeyDistributionMessage = senderKeyDistributionMessage.serialize();
|
||||
const senderKeyDistributionMessage =
|
||||
await this.getSenderKeyDistributionMessage(distributionId);
|
||||
contentMessage.senderKeyDistributionMessage =
|
||||
senderKeyDistributionMessage.serialize();
|
||||
|
||||
const sendLogCallback =
|
||||
identifiers.length > 1
|
||||
|
|
|
@ -65,7 +65,8 @@ class SyncRequestInner extends EventTarget {
|
|||
|
||||
const { sender } = this;
|
||||
|
||||
const ourConversation = window.ConversationController.getOurConversationOrThrow();
|
||||
const ourConversation =
|
||||
window.ConversationController.getOurConversationOrThrow();
|
||||
const sendOptions = await getSendOptions(ourConversation.attributes, {
|
||||
syncMessage: true,
|
||||
});
|
||||
|
|
|
@ -1008,7 +1008,8 @@ export function initialize({
|
|||
let username = initialUsername;
|
||||
let password = initialPassword;
|
||||
const PARSE_RANGE_HEADER = /\/(\d+)$/;
|
||||
const PARSE_GROUP_LOG_RANGE_HEADER = /$versions (\d{1,10})-(\d{1,10})\/(d{1,10})/;
|
||||
const PARSE_GROUP_LOG_RANGE_HEADER =
|
||||
/$versions (\d{1,10})-(\d{1,10})\/(d{1,10})/;
|
||||
|
||||
const socketManager = new SocketManager({
|
||||
url,
|
||||
|
@ -1361,11 +1362,8 @@ export function initialize({
|
|||
userLanguages: ReadonlyArray<string>;
|
||||
}
|
||||
) {
|
||||
const {
|
||||
profileKeyVersion,
|
||||
profileKeyCredentialRequest,
|
||||
userLanguages,
|
||||
} = options;
|
||||
const { profileKeyVersion, profileKeyCredentialRequest, userLanguages } =
|
||||
options;
|
||||
|
||||
return (await _ajax({
|
||||
call: 'profile',
|
||||
|
@ -2210,15 +2208,8 @@ export function initialize({
|
|||
}
|
||||
|
||||
function verifyAttributes(attributes: Proto.IAvatarUploadAttributes) {
|
||||
const {
|
||||
key,
|
||||
credential,
|
||||
acl,
|
||||
algorithm,
|
||||
date,
|
||||
policy,
|
||||
signature,
|
||||
} = attributes;
|
||||
const { key, credential, acl, algorithm, date, policy, signature } =
|
||||
attributes;
|
||||
|
||||
if (
|
||||
!key ||
|
||||
|
@ -2825,9 +2816,9 @@ export function initialize({
|
|||
};
|
||||
|
||||
// Decode discovery request response
|
||||
const decodedDiscoveryResponse = (mapValues(discoveryResponse, value => {
|
||||
const decodedDiscoveryResponse = mapValues(discoveryResponse, value => {
|
||||
return Bytes.fromBase64(value);
|
||||
}) as unknown) as {
|
||||
}) as unknown as {
|
||||
[K in keyof typeof discoveryResponse]: Uint8Array;
|
||||
};
|
||||
|
||||
|
|
|
@ -256,10 +256,8 @@ export async function processDataMessage(
|
|||
|
||||
const result: ProcessedDataMessage = {
|
||||
body: dropNull(message.body),
|
||||
attachments: (
|
||||
message.attachments ?? []
|
||||
).map((attachment: Proto.IAttachmentPointer) =>
|
||||
processAttachment(attachment)
|
||||
attachments: (message.attachments ?? []).map(
|
||||
(attachment: Proto.IAttachmentPointer) => processAttachment(attachment)
|
||||
),
|
||||
group: processGroupContext(message.group),
|
||||
groupV2: processGroupV2Context(message.groupV2),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue