fix(llc): Connecting user without providing name uses id instead for setting user.name.
Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
@@ -16,13 +16,16 @@
|
|||||||
- Added support for `next`, `previous` value pagination in `client.search`
|
- Added support for `next`, `previous` value pagination in `client.search`
|
||||||
, [read more.](https://getstream.io/chat/docs/other-rest/search/#pagination)
|
, [read more.](https://getstream.io/chat/docs/other-rest/search/#pagination)
|
||||||
- `Attachment` class now has a `fileSize` and `mimeType` property. Setting a `file` will also set the `file_size`
|
- `Attachment` class now has a `fileSize` and `mimeType` property. Setting a `file` will also set the `file_size`
|
||||||
, `mime_type` key on `extraData`, so `attachment.fileSize`, `attachment.mimetype` and `attachment.extraData['file_size']`
|
, `mime_type` key on `extraData`, so `attachment.fileSize`, `attachment.mimetype`
|
||||||
|
and `attachment.extraData['file_size']`
|
||||||
, `attachment.extraData['mime_type]` is same respectively.
|
, `attachment.extraData['mime_type]` is same respectively.
|
||||||
|
|
||||||
🐞 Fixed
|
🐞 Fixed
|
||||||
|
|
||||||
- [[#659]](https://github.com/GetStream/stream-chat-flutter/issues/659) Fixed unread count not updating correctly.
|
- [[#659]](https://github.com/GetStream/stream-chat-flutter/issues/659) Fixed unread count not updating correctly.
|
||||||
- Fix `Filter.empty()` json encoding.
|
- Fix `Filter.empty()` json encoding.
|
||||||
|
- [[#700]](https://github.com/GetStream/stream-chat-flutter/issues/700) Connecting user without providing `name`
|
||||||
|
uses `id` instead for setting `user.name`.
|
||||||
|
|
||||||
## 2.2.1
|
## 2.2.1
|
||||||
|
|
||||||
|
|||||||
@@ -54,8 +54,6 @@ class OwnUser extends User {
|
|||||||
factory OwnUser.fromUser(User user) => OwnUser(
|
factory OwnUser.fromUser(User user) => OwnUser(
|
||||||
id: user.id,
|
id: user.id,
|
||||||
role: user.role,
|
role: user.role,
|
||||||
name: user.name,
|
|
||||||
image: user.image,
|
|
||||||
createdAt: user.createdAt,
|
createdAt: user.createdAt,
|
||||||
updatedAt: user.updatedAt,
|
updatedAt: user.updatedAt,
|
||||||
lastActive: user.lastActive,
|
lastActive: user.lastActive,
|
||||||
@@ -116,8 +114,6 @@ class OwnUser extends User {
|
|||||||
return copyWith(
|
return copyWith(
|
||||||
id: other.id,
|
id: other.id,
|
||||||
role: other.role,
|
role: other.role,
|
||||||
name: other.name,
|
|
||||||
image: other.image,
|
|
||||||
banned: other.banned,
|
banned: other.banned,
|
||||||
channelMutes: other.channelMutes,
|
channelMutes: other.channelMutes,
|
||||||
createdAt: other.createdAt,
|
createdAt: other.createdAt,
|
||||||
|
|||||||
@@ -175,5 +175,26 @@ void main() {
|
|||||||
expect(newUser.teams, ['team1', 'team2']);
|
expect(newUser.teams, ['team1', 'team2']);
|
||||||
expect(newUser.language, 'fr');
|
expect(newUser.language, 'fr');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test(
|
||||||
|
'fromUser should not override name with id if not available in extraData',
|
||||||
|
() {
|
||||||
|
final user = User(id: 'test-id');
|
||||||
|
expect(user.id, 'test-id');
|
||||||
|
expect(user.name, 'test-id');
|
||||||
|
|
||||||
|
final encodedUser = user.toJson();
|
||||||
|
expect(encodedUser['id'], 'test-id');
|
||||||
|
expect(encodedUser['name'], null);
|
||||||
|
|
||||||
|
final ownUser = OwnUser.fromUser(user);
|
||||||
|
expect(user.id, 'test-id');
|
||||||
|
expect(user.name, 'test-id');
|
||||||
|
|
||||||
|
final encodedOwnUser = ownUser.toJson();
|
||||||
|
expect(encodedOwnUser['id'], 'test-id');
|
||||||
|
expect(encodedOwnUser['name'], null);
|
||||||
|
},
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user