From 295dcbfe487ebb9bb4928d029a052f28cb6a079c Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sat, 4 Jan 2020 13:34:05 +0000 Subject: [PATCH 1/2] Fix ability to remove avatars Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/room_settings/RoomProfileSettings.js | 2 ++ src/components/views/settings/ProfileSettings.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/components/views/room_settings/RoomProfileSettings.js b/src/components/views/room_settings/RoomProfileSettings.js index 2093a31a289..abcdce23f8f 100644 --- a/src/components/views/room_settings/RoomProfileSettings.js +++ b/src/components/views/room_settings/RoomProfileSettings.js @@ -98,6 +98,8 @@ export default class RoomProfileSettings extends React.Component { newState.avatarUrl = client.mxcUrlToHttp(uri, 96, 96, 'crop', false); newState.originalAvatarUrl = newState.avatarUrl; newState.avatarFile = null; + } else if (this.state.originalAvatarUrl !== this.state.avatarUrl) { + await client.sendStateEvent(this.props.roomId, 'm.room.avatar', {url: undefined}, ''); } if (this.state.originalTopic !== this.state.topic) { diff --git a/src/components/views/settings/ProfileSettings.js b/src/components/views/settings/ProfileSettings.js index 480b4149111..72ff7e3d152 100644 --- a/src/components/views/settings/ProfileSettings.js +++ b/src/components/views/settings/ProfileSettings.js @@ -88,6 +88,8 @@ export default class ProfileSettings extends React.Component { newState.avatarUrl = client.mxcUrlToHttp(uri, 96, 96, 'crop', false); newState.originalAvatarUrl = newState.avatarUrl; newState.avatarFile = null; + } else if (this.state.originalAvatarUrl !== this.state.avatarUrl) { + await client.setAvatarUrl(""); // use empty string as Synapse 500's on undefined } this.setState(newState); From d5eb4ff310d2cd328f8795bd6eea37b90a4db86a Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 6 Jan 2020 13:02:32 +0000 Subject: [PATCH 2/2] Update src/components/views/settings/ProfileSettings.js Co-Authored-By: J. Ryan Stinnett --- src/components/views/settings/ProfileSettings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/settings/ProfileSettings.js b/src/components/views/settings/ProfileSettings.js index 72ff7e3d152..b56321c1c9c 100644 --- a/src/components/views/settings/ProfileSettings.js +++ b/src/components/views/settings/ProfileSettings.js @@ -89,7 +89,7 @@ export default class ProfileSettings extends React.Component { newState.originalAvatarUrl = newState.avatarUrl; newState.avatarFile = null; } else if (this.state.originalAvatarUrl !== this.state.avatarUrl) { - await client.setAvatarUrl(""); // use empty string as Synapse 500's on undefined + await client.setAvatarUrl(""); // use empty string as Synapse 500s on undefined } this.setState(newState);