Fixes rendering of about bio
This commit is contained in:
parent
3ee69c211d
commit
1b38db2d79
10 changed files with 82 additions and 12 deletions
|
@ -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)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue