make download of group avatar work

pull/878/head
Audric Ackermann 5 years ago
parent 6d5aed7de8
commit 60ed8f2972
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -1249,9 +1249,7 @@ class LokiPublicChannelAPI {
}
if (note.value && note.value.avatar) {
const avatarAbsUrl = this.serverAPI.baseServerUrl + note.value.avatar;
console.log('setting', avatarAbsUrl);
const {
upgradeMessageSchema,
writeNewAttachmentData,
deleteAttachmentData,
} = window.Signal.Migrations;
@ -1267,18 +1265,22 @@ class LokiPublicChannelAPI {
}
return ab;
}
const buffer = await imageData.buffer();
const newAttributes = await window.Signal.Types.Conversation.maybeUpdateAvatar(
this.conversation.attributes,
toArrayBuffer(imageData),
toArrayBuffer(buffer),
{
writeNewAttachmentData,
deleteAttachmentData,
}
);
console.log('newAttributes.avatar', newAttributes.avatar);
// update group
this.conversation.set(newAttributes);
//this.conversation.setProfileAvatar(newAttributes.avatar);
this.conversation.set('avatar', newAttributes.avatar);
await window.Signal.Data.updateConversation(this.conversation.id, this.conversation.attributes, {
Conversation: Whisper.Conversation,
});
this.conversation.trigger('change');
}
// is it mutable?
// who are the moderators?

@ -36,6 +36,7 @@ export class UpdateGroupNameDialog extends React.Component<Props, State> {
this.onKeyUp = this.onKeyUp.bind(this);
this.closeDialog = this.closeDialog.bind(this);
this.onFileSelected = this.onFileSelected.bind(this);
this.onGroupNameChanged = this.onGroupNameChanged.bind(this);
this.state = {
groupName: this.props.groupName,

Loading…
Cancel
Save