use GomuksConfig

This commit is contained in:
Henry Hiles 2026-09-22 09:53:00 -04:00
commit 09534a6775
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
4 changed files with 67 additions and 9 deletions

View file

@ -20,6 +20,7 @@ import "package:nexus/main.dart";
import "package:nexus/models/capabilities.dart";
import "package:nexus/models/content/message.dart";
import "package:nexus/models/event.dart";
import "package:nexus/models/gomuks_config.dart";
import "package:nexus/models/oauth_auth_code_response.dart";
import "package:nexus/models/open_graph_data.dart";
import "package:nexus/models/paginate.dart";
@ -70,14 +71,17 @@ class ClientController extends AsyncNotifier<int> {
}
}
final handle = await Isolate.run(() {
final message =
"Nexus on ${toBeginningOfSentenceCase(Platform.operatingSystem)}"
.toNativeUtf8()
.cast<Char>();
final bufferPointer = GomuksConfig(
matrix: .new(
initialDeviceDisplayName:
"Nexus on ${toBeginningOfSentenceCase(Platform.operatingSystem)}",
),
).toJson().toGomuksBufferPtr();
try {
return GomuksInit(message);
return GomuksInit(bufferPointer.ref);
} finally {
calloc.free(message);
calloc.free(bufferPointer);
}
});