implemented global user search integration for Talk chats with role-coded badges and direct chat creation logic
This commit is contained in:
@@ -100,9 +100,12 @@ class ChatListBloc
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> createDirectChat(String invite) async {
|
||||
await repo.data.createDirectRoom(invite);
|
||||
/// Creates (or resolves) a 1:1 chat and returns its room token, or null in
|
||||
/// demo mode. Refreshes the list so the room shows up.
|
||||
Future<String?> createDirectChat(String invite) async {
|
||||
final token = await repo.data.createDirectRoom(invite);
|
||||
await refresh();
|
||||
return token;
|
||||
}
|
||||
|
||||
int? lastReadMessageFor(String token) {
|
||||
|
||||
@@ -20,8 +20,13 @@ class ChatListDataProvider {
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> createDirectRoom(String invite) {
|
||||
if (DemoMode.active) return Future.value();
|
||||
return CreateRoom(CreateRoomParams(roomType: 1, invite: invite)).run();
|
||||
/// Returns the token of the created (or already existing) 1:1 room, or null
|
||||
/// in demo mode where no room is actually created.
|
||||
Future<String?> createDirectRoom(String invite) async {
|
||||
if (DemoMode.active) return null;
|
||||
final response = await CreateRoom(
|
||||
CreateRoomParams(roomType: 1, invite: invite),
|
||||
).run();
|
||||
return response.data.token;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user