Move message.getPropsForBubble and friends to selectors

This commit is contained in:
Scott Nonnenberg 2021-06-17 10:15:10 -07:00 committed by GitHub
parent 03a187097f
commit 68f1023946
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
73 changed files with 3394 additions and 2576 deletions

View file

@ -2489,10 +2489,14 @@ class MessageReceiverInner extends EventTarget {
async downloadAttachment(
attachment: AttachmentPointerClass
): Promise<DownloadAttachmentType> {
const encrypted = await this.server.getAttachment(
attachment.cdnId || attachment.cdnKey,
attachment.cdnNumber || 0
);
const cdnId = attachment.cdnId || attachment.cdnKey;
const { cdnNumber } = attachment;
if (!cdnId) {
throw new Error('downloadAttachment: Attachment was missing cdnId!');
}
const encrypted = await this.server.getAttachment(cdnId, cdnNumber);
const { key, digest, size } = attachment;
if (!digest) {