implemented global user search integration for Talk chats with role-coded badges and direct chat creation logic
This commit is contained in:
@@ -10,9 +10,9 @@ import '../../../state/app/infrastructure/loadable_state/view/loadable_state_con
|
||||
import '../../../state/app/modules/chat_list/bloc/chat_list_bloc.dart';
|
||||
import '../../../state/app/modules/chat_list/bloc/chat_list_state.dart';
|
||||
import '../../../state/app/modules/settings/bloc/settings_cubit.dart';
|
||||
import '../../../widget/confirm_dialog.dart';
|
||||
import '../../../widget/demo_restricted.dart';
|
||||
import '../../../widget/placeholder_view.dart';
|
||||
import 'data/open_direct_chat.dart';
|
||||
import 'join_chat.dart';
|
||||
import 'notification_permission_prompt.dart';
|
||||
import 'search_chat.dart';
|
||||
@@ -91,7 +91,15 @@ class _ChatListViewState extends State<_ChatListView> {
|
||||
if (rooms == null) return;
|
||||
showSearch(
|
||||
context: context,
|
||||
delegate: SearchChat(rooms.data.toList()),
|
||||
delegate: SearchChat(
|
||||
rooms.data.toList(),
|
||||
onStartChat: (username, displayName) =>
|
||||
openOrCreateDirectChat(
|
||||
context,
|
||||
actorId: username,
|
||||
actorDisplayName: displayName,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -106,13 +114,11 @@ class _ChatListViewState extends State<_ChatListView> {
|
||||
username,
|
||||
) {
|
||||
if (username == null || !context.mounted) return;
|
||||
ConfirmDialog(
|
||||
title: 'Talk-Chat starten',
|
||||
content:
|
||||
"Möchtest du einen Talk-Chat mit Nutzer '$username' starten?",
|
||||
confirmButton: 'Talk-Chat starten',
|
||||
onConfirmAsync: () => bloc.createDirectChat(username),
|
||||
).asDialog(context);
|
||||
openOrCreateDirectChat(
|
||||
context,
|
||||
actorId: username,
|
||||
actorDisplayName: username,
|
||||
);
|
||||
});
|
||||
},
|
||||
child: const Icon(Icons.add_comment_outlined),
|
||||
|
||||
Reference in New Issue
Block a user