followup: Improve stories
This commit is contained in:
parent
dbe0a54be2
commit
70cfe7f233
8 changed files with 136 additions and 64 deletions
|
|
@ -14,6 +14,7 @@ import 'package:vrouter/vrouter.dart';
|
|||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/pages/chat_list/chat_list_view.dart';
|
||||
import 'package:fluffychat/utils/fluffy_share.dart';
|
||||
import 'package:fluffychat/utils/matrix_sdk_extensions.dart/client_stories_extension.dart';
|
||||
import 'package:fluffychat/utils/platform_infos.dart';
|
||||
import '../../../utils/account_bundles.dart';
|
||||
import '../../main.dart';
|
||||
|
|
@ -205,6 +206,10 @@ class ChatListController extends State<ChatList> {
|
|||
if (room.isSpace && room.membership == Membership.join && !room.isUnread) {
|
||||
return false;
|
||||
}
|
||||
if (room.getState(EventTypes.RoomCreate)?.content?.tryGet<String>('type') ==
|
||||
ClientStoriesExtension.storiesRoomType) {
|
||||
return false;
|
||||
}
|
||||
if (activeSpaceId != null) {
|
||||
final space = Matrix.of(context).client.getRoomById(activeSpaceId);
|
||||
if (space.spaceChildren?.any((child) => child.roomId == room.id) ??
|
||||
|
|
|
|||
|
|
@ -204,7 +204,6 @@ class ChatListView extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
),
|
||||
if (controller.waitForFirstSync) const StoriesHeader(),
|
||||
Expanded(child: _ChatListViewBody(controller)),
|
||||
]),
|
||||
floatingActionButton: selectMode == SelectMode.normal
|
||||
|
|
@ -307,8 +306,12 @@ class _ChatListViewBodyState extends State<_ChatListViewBody> {
|
|||
key: ValueKey(Matrix.of(context).client.userID.toString() +
|
||||
widget.controller.activeSpaceId.toString()),
|
||||
controller: widget.controller.scrollController,
|
||||
itemCount: rooms.length,
|
||||
itemCount: rooms.length + 1,
|
||||
itemBuilder: (BuildContext context, int i) {
|
||||
if (i == 0) {
|
||||
return const StoriesHeader();
|
||||
}
|
||||
i--;
|
||||
return ChatListItem(
|
||||
rooms[i],
|
||||
selected: widget.controller.selectedRoomIds.contains(rooms[i].id),
|
||||
|
|
|
|||
|
|
@ -114,7 +114,8 @@ class StoriesHeader extends StatelessWidget {
|
|||
.avatarUrl,
|
||||
name: room.creatorDisplayname,
|
||||
),
|
||||
unread: room.notificationCount > 0,
|
||||
unread: room.notificationCount > 0 ||
|
||||
room.membership == Membership.invite,
|
||||
onPressed: () => _goToStoryAction(context, room.id),
|
||||
onLongPressed: () => _contextualActions(context, room),
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue