small cleanups
This commit is contained in:
parent
338d5dfee9
commit
a698cf8c28
2 changed files with 6 additions and 7 deletions
|
|
@ -168,7 +168,7 @@ This installs Nexus system-wide. With `enableNotifications`, it also installs KU
|
||||||
|
|
||||||
#### Linux
|
#### Linux
|
||||||
|
|
||||||
- On NixOS: Either use direnv and `direnv allow`, or `nix flake develop`
|
- On NixOS: Either use direnv and `direnv allow`, or `nix develop`
|
||||||
- On other distros: Install Flutter, Go, Git, Libclang, Libass, MPV, and Glibc. Do not use any Snap packages, they cause various compilation issues.
|
- On other distros: Install Flutter, Go, Git, Libclang, Libass, MPV, and Glibc. Do not use any Snap packages, they cause various compilation issues.
|
||||||
|
|
||||||
#### Windows
|
#### Windows
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ class ClientController extends AsyncNotifier<int> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
dynamic _sendCommand(
|
Future<dynamic> _sendCommand(
|
||||||
String command, [
|
String command, [
|
||||||
Map<String, dynamic> data = const {},
|
Map<String, dynamic> data = const {},
|
||||||
]) => callGomuksMethod(data, (handle, data) {
|
]) => callGomuksMethod(data, (handle, data) {
|
||||||
|
|
@ -156,7 +156,7 @@ class ClientController extends AsyncNotifier<int> {
|
||||||
final json = request.toJson();
|
final json = request.toJson();
|
||||||
final content = request.content.toJson();
|
final content = request.content.toJson();
|
||||||
|
|
||||||
return Event.fromJson(
|
return .fromJson(
|
||||||
await _sendCommand("send_event", {
|
await _sendCommand("send_event", {
|
||||||
...json,
|
...json,
|
||||||
"content": {
|
"content": {
|
||||||
|
|
@ -241,7 +241,7 @@ class ClientController extends AsyncNotifier<int> {
|
||||||
try {
|
try {
|
||||||
return .fromJson(await _sendCommand("get_profile", {"user_id": userId}));
|
return .fromJson(await _sendCommand("get_profile", {"user_id": userId}));
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
return ProfileResponse(profile: .new(id: userId));
|
return .new(profile: .new(id: userId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -302,9 +302,8 @@ class ClientController extends AsyncNotifier<int> {
|
||||||
Future<SpecVersionsResponse> getSpecVersions() async =>
|
Future<SpecVersionsResponse> getSpecVersions() async =>
|
||||||
.fromJson(await _sendCommand("get_versions"));
|
.fromJson(await _sendCommand("get_versions"));
|
||||||
|
|
||||||
Future<Capabilities> getCapabilities() async => Capabilities.fromJson(
|
Future<Capabilities> getCapabilities() async =>
|
||||||
(await _sendCommand("get_capabilities"))["capabilities"],
|
.fromJson((await _sendCommand("get_capabilities"))["capabilities"]);
|
||||||
);
|
|
||||||
|
|
||||||
Future<Uri?> discoverHomeserver(Uri homeserver) async {
|
Future<Uri?> discoverHomeserver(Uri homeserver) async {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue