Fixes rendering of about bio

This commit is contained in:
Josh Perez 2021-01-27 19:18:50 -05:00 committed by GitHub
parent 3ee69c211d
commit 1b38db2d79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 82 additions and 12 deletions

View file

@ -29,6 +29,7 @@ import {
fromEncodedBinaryToArrayBuffer,
getRandomBytes,
stringFromBytes,
trimForDisplay,
verifyAccessKey,
} from '../Crypto';
import { GroupChangeClass } from '../textsecure.d';
@ -3768,26 +3769,26 @@ export class ConversationModel extends window.Backbone.Model<
}
if (profile.about) {
const key = this.get('profileKey');
const key = c.get('profileKey');
if (key) {
const keyBuffer = base64ToArrayBuffer(key);
const decrypted = await window.textsecure.crypto.decryptProfile(
base64ToArrayBuffer(profile.about),
keyBuffer
);
this.set('about', stringFromBytes(decrypted));
c.set('about', stringFromBytes(trimForDisplay(decrypted)));
}
}
if (profile.aboutEmoji) {
const key = this.get('profileKey');
const key = c.get('profileKey');
if (key) {
const keyBuffer = base64ToArrayBuffer(key);
const decrypted = await window.textsecure.crypto.decryptProfile(
base64ToArrayBuffer(profile.aboutEmoji),
keyBuffer
);
this.set('aboutEmoji', stringFromBytes(decrypted));
c.set('aboutEmoji', stringFromBytes(trimForDisplay(decrypted)));
}
}