|
|
|
@ -88,12 +88,6 @@ class StoriesHeader extends StatelessWidget {
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
final client = Matrix.of(context).client;
|
|
|
|
final client = Matrix.of(context).client;
|
|
|
|
return StreamBuilder(
|
|
|
|
|
|
|
|
stream: Matrix.of(context).onShareContentChanged.stream,
|
|
|
|
|
|
|
|
builder: (context, _) => StreamBuilder<Object>(
|
|
|
|
|
|
|
|
stream: client.onSync.stream
|
|
|
|
|
|
|
|
.where((syncUpdate) => syncUpdate.hasRoomUpdate),
|
|
|
|
|
|
|
|
builder: (context, snapshot) {
|
|
|
|
|
|
|
|
if (Matrix.of(context).shareContent != null) {
|
|
|
|
if (Matrix.of(context).shareContent != null) {
|
|
|
|
return ListTile(
|
|
|
|
return ListTile(
|
|
|
|
leading: CircleAvatar(
|
|
|
|
leading: CircleAvatar(
|
|
|
|
@ -107,9 +101,8 @@ class StoriesHeader extends StatelessWidget {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (client.storiesRooms.isEmpty ||
|
|
|
|
if (client.storiesRooms.isEmpty ||
|
|
|
|
!client.storiesRooms.any((room) => room.displayname
|
|
|
|
!client.storiesRooms.any((room) =>
|
|
|
|
.toLowerCase()
|
|
|
|
room.displayname.toLowerCase().contains(filter.toLowerCase()))) {
|
|
|
|
.contains(filter.toLowerCase()))) {
|
|
|
|
|
|
|
|
return Container();
|
|
|
|
return Container();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
final ownStoryRoom = client.storiesRooms
|
|
|
|
final ownStoryRoom = client.storiesRooms
|
|
|
|
@ -134,9 +127,7 @@ class StoriesHeader extends StatelessWidget {
|
|
|
|
userId?.localpart ??
|
|
|
|
userId?.localpart ??
|
|
|
|
'Unknown';
|
|
|
|
'Unknown';
|
|
|
|
final avatarUrl = snapshot.data?.avatarUrl;
|
|
|
|
final avatarUrl = snapshot.data?.avatarUrl;
|
|
|
|
if (!displayname
|
|
|
|
if (!displayname.toLowerCase().contains(filter.toLowerCase())) {
|
|
|
|
.toLowerCase()
|
|
|
|
|
|
|
|
.contains(filter.toLowerCase())) {
|
|
|
|
|
|
|
|
return Container();
|
|
|
|
return Container();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return _StoryButton(
|
|
|
|
return _StoryButton(
|
|
|
|
@ -151,15 +142,12 @@ class StoriesHeader extends StatelessWidget {
|
|
|
|
unread: room.membership == Membership.invite ||
|
|
|
|
unread: room.membership == Membership.invite ||
|
|
|
|
(room.hasNewMessages && room.hasPosts),
|
|
|
|
(room.hasNewMessages && room.hasPosts),
|
|
|
|
onPressed: () => _goToStoryAction(context, room.id),
|
|
|
|
onPressed: () => _goToStoryAction(context, room.id),
|
|
|
|
onLongPressed: () =>
|
|
|
|
onLongPressed: () => _contextualActions(context, room),
|
|
|
|
_contextualActions(context, room),
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|