Merge pull request #783 from GetStream/hotfix/userPresence
fix(llc,ui): fix user presence indicator update
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
- `closeConnection()` now uses `normalClosure` status when closing websocket.
|
- `closeConnection()` now uses `normalClosure` status when closing websocket.
|
||||||
- Fixed local unread count indicator increasing for thread replies
|
- Fixed local unread count indicator increasing for thread replies
|
||||||
|
- Fixed user presence indicator not updating correctly
|
||||||
|
|
||||||
## 3.2.0
|
## 3.2.0
|
||||||
|
|
||||||
|
|||||||
@@ -179,5 +179,14 @@ class User extends Equatable {
|
|||||||
);
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object?> get props => [id, role];
|
List<Object?> get props => [
|
||||||
|
id,
|
||||||
|
role,
|
||||||
|
lastActive,
|
||||||
|
online,
|
||||||
|
extraData,
|
||||||
|
banned,
|
||||||
|
teams,
|
||||||
|
language,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,13 +70,19 @@ void main() {
|
|||||||
expect(
|
expect(
|
||||||
newReaction.extraData, {'updated_at': '2020-01-28T22:17:31.108742Z'});
|
newReaction.extraData, {'updated_at': '2020-01-28T22:17:31.108742Z'});
|
||||||
|
|
||||||
|
final newUserCreateTime = DateTime.now();
|
||||||
|
|
||||||
newReaction = reaction.copyWith(
|
newReaction = reaction.copyWith(
|
||||||
type: 'lol',
|
type: 'lol',
|
||||||
createdAt: DateTime.parse('2021-01-28T22:17:31.108742Z'),
|
createdAt: DateTime.parse('2021-01-28T22:17:31.108742Z'),
|
||||||
extraData: {},
|
extraData: {},
|
||||||
messageId: 'test',
|
messageId: 'test',
|
||||||
score: 2,
|
score: 2,
|
||||||
user: User(id: 'test'),
|
user: User(
|
||||||
|
id: 'test',
|
||||||
|
createdAt: newUserCreateTime,
|
||||||
|
updatedAt: newUserCreateTime,
|
||||||
|
),
|
||||||
userId: 'test',
|
userId: 'test',
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -88,12 +94,21 @@ void main() {
|
|||||||
expect(newReaction.extraData, {});
|
expect(newReaction.extraData, {});
|
||||||
expect(newReaction.messageId, 'test');
|
expect(newReaction.messageId, 'test');
|
||||||
expect(newReaction.score, 2);
|
expect(newReaction.score, 2);
|
||||||
expect(newReaction.user, User(id: 'test'));
|
expect(
|
||||||
|
newReaction.user,
|
||||||
|
User(
|
||||||
|
id: 'test',
|
||||||
|
createdAt: newUserCreateTime,
|
||||||
|
updatedAt: newUserCreateTime,
|
||||||
|
),
|
||||||
|
);
|
||||||
expect(newReaction.userId, 'test');
|
expect(newReaction.userId, 'test');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('merge', () {
|
test('merge', () {
|
||||||
final reaction = Reaction.fromJson(jsonFixture('reaction.json'));
|
final reaction = Reaction.fromJson(jsonFixture('reaction.json'));
|
||||||
|
final newUserCreateTime = DateTime.now();
|
||||||
|
|
||||||
final newReaction = reaction.merge(
|
final newReaction = reaction.merge(
|
||||||
Reaction(
|
Reaction(
|
||||||
type: 'lol',
|
type: 'lol',
|
||||||
@@ -101,7 +116,11 @@ void main() {
|
|||||||
extraData: {},
|
extraData: {},
|
||||||
messageId: 'test',
|
messageId: 'test',
|
||||||
score: 2,
|
score: 2,
|
||||||
user: User(id: 'test'),
|
user: User(
|
||||||
|
id: 'test',
|
||||||
|
createdAt: newUserCreateTime,
|
||||||
|
updatedAt: newUserCreateTime,
|
||||||
|
),
|
||||||
userId: 'test',
|
userId: 'test',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -114,7 +133,14 @@ void main() {
|
|||||||
expect(newReaction.extraData, {});
|
expect(newReaction.extraData, {});
|
||||||
expect(newReaction.messageId, 'test');
|
expect(newReaction.messageId, 'test');
|
||||||
expect(newReaction.score, 2);
|
expect(newReaction.score, 2);
|
||||||
expect(newReaction.user, User(id: 'test'));
|
expect(
|
||||||
|
newReaction.user,
|
||||||
|
User(
|
||||||
|
id: 'test',
|
||||||
|
createdAt: newUserCreateTime,
|
||||||
|
updatedAt: newUserCreateTime,
|
||||||
|
),
|
||||||
|
);
|
||||||
expect(newReaction.userId, 'test');
|
expect(newReaction.userId, 'test');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
- Fixed `MessageWidget` null errors associated with `channel.memberCount`.
|
- Fixed `MessageWidget` null errors associated with `channel.memberCount`.
|
||||||
- Fixed adding attachments on web.
|
- Fixed adding attachments on web.
|
||||||
- [[#767]](https://github.com/GetStream/stream-chat-flutter/issues/767): Fix `MessageInput` focus behaviour when sending messages.
|
- [[#767]](https://github.com/GetStream/stream-chat-flutter/issues/767): Fix `MessageInput` focus behaviour when sending messages.
|
||||||
|
- Fixed user presence indicator not updating correctly
|
||||||
|
|
||||||
## 3.2.0
|
## 3.2.0
|
||||||
|
|
||||||
|
|||||||
@@ -59,9 +59,10 @@ class ChannelInfo extends StatelessWidget {
|
|||||||
final memberCount = channel.memberCount;
|
final memberCount = channel.memberCount;
|
||||||
if (memberCount != null && memberCount > 2) {
|
if (memberCount != null && memberCount > 2) {
|
||||||
var text = context.translations.membersCountText(memberCount);
|
var text = context.translations.membersCountText(memberCount);
|
||||||
final watcherCount = channel.state?.watcherCount ?? 0;
|
final onlineCount =
|
||||||
if (watcherCount > 0) {
|
members?.where((m) => m.user?.online == true).length ?? 0;
|
||||||
text += ' ${context.translations.watchersCountText(watcherCount)}';
|
if (onlineCount > 0) {
|
||||||
|
text += ', ${context.translations.watchersCountText(onlineCount)}';
|
||||||
}
|
}
|
||||||
alternativeWidget = Text(
|
alternativeWidget = Text(
|
||||||
text,
|
text,
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ class GroupAvatar extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
initialData: member,
|
initialData: member,
|
||||||
builder: (context, member) => UserAvatar(
|
builder: (context, member) => UserAvatar(
|
||||||
|
showOnlineStatus: false,
|
||||||
user: member.user!,
|
user: member.user!,
|
||||||
borderRadius: BorderRadius.zero,
|
borderRadius: BorderRadius.zero,
|
||||||
),
|
),
|
||||||
@@ -118,6 +119,7 @@ class GroupAvatar extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
initialData: member,
|
initialData: member,
|
||||||
builder: (context, member) => UserAvatar(
|
builder: (context, member) => UserAvatar(
|
||||||
|
showOnlineStatus: false,
|
||||||
user: member.user!,
|
user: member.user!,
|
||||||
borderRadius: BorderRadius.zero,
|
borderRadius: BorderRadius.zero,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -323,6 +323,8 @@ class MessageInput extends StatefulWidget {
|
|||||||
/// Defaults to false.
|
/// Defaults to false.
|
||||||
final bool mentionAllAppUsers;
|
final bool mentionAllAppUsers;
|
||||||
|
|
||||||
|
/// Defines if the [MessageInput] loses focuses after a message is sent.
|
||||||
|
/// The default behaviour keeps focus until a command is enabled.
|
||||||
final bool? shouldKeepFocusAfterMessage;
|
final bool? shouldKeepFocusAfterMessage;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ void main() {
|
|||||||
role: 'testRole',
|
role: 'testRole',
|
||||||
createdAt: DateTime.now(),
|
createdAt: DateTime.now(),
|
||||||
updatedAt: DateTime.now(),
|
updatedAt: DateTime.now(),
|
||||||
lastActive: DateTime.now(),
|
|
||||||
online: math.Random().nextBool(),
|
online: math.Random().nextBool(),
|
||||||
banned: math.Random().nextBool(),
|
banned: math.Random().nextBool(),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user