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