fix: Remove user avatar
This commit is contained in:
parent
59fbd557c5
commit
79b74e2bbf
|
|
@ -824,13 +824,17 @@ class Client extends MatrixApi {
|
||||||
/// Uploads a new user avatar for this user. Leave file null to remove the
|
/// Uploads a new user avatar for this user. Leave file null to remove the
|
||||||
/// current avatar.
|
/// current avatar.
|
||||||
Future<void> setAvatar(MatrixFile? file) async {
|
Future<void> setAvatar(MatrixFile? file) async {
|
||||||
final uploadResp = file == null
|
if (file == null) {
|
||||||
? null
|
// We send an empty String to remove the avatar. Sending Null **should**
|
||||||
: await uploadContent(
|
// work but it doesn't with Synapse. See:
|
||||||
file.bytes,
|
// https://gitlab.com/famedly/company/frontend/famedlysdk/-/issues/254
|
||||||
filename: file.name,
|
return setAvatarUrl(userID!, Uri.parse(''));
|
||||||
contentType: file.mimeType,
|
}
|
||||||
);
|
final uploadResp = await uploadContent(
|
||||||
|
file.bytes,
|
||||||
|
filename: file.name,
|
||||||
|
contentType: file.mimeType,
|
||||||
|
);
|
||||||
await setAvatarUrl(userID!, uploadResp);
|
await setAvatarUrl(userID!, uploadResp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue