chore: replace call to startRoom with call to startDirectChat for bot chat

This commit is contained in:
ggurdin 2025-06-26 09:29:00 -04:00
parent 066253db0c
commit 39b9aac80e
No known key found for this signature in database
GPG key ID: A01CB41737CBB478

View file

@ -80,17 +80,16 @@ class OnboardingController extends State<Onboarding> {
Future<void> startChatWithBot() async {
final resp = await showFutureLoadingDialog<String>(
context: context,
future: () => Matrix.of(context).client.createRoom(
invite: [BotName.byEnvironment],
isDirect: true,
preset: CreateRoomPreset.trustedPrivateChat,
initialState: [
BotOptionsModel(mode: BotMode.directChat).toStateEvent,
RoomDefaults.defaultPowerLevels(
Matrix.of(context).client.userID!,
),
],
future: () => Matrix.of(context).client.startDirectChat(
BotName.byEnvironment,
preset: CreateRoomPreset.trustedPrivateChat,
initialState: [
BotOptionsModel(mode: BotMode.directChat).toStateEvent,
RoomDefaults.defaultPowerLevels(
Matrix.of(context).client.userID!,
),
],
),
);
if (resp.isError) return;
context.go("/rooms/${resp.result}");