forked from Henry-Hiles/nexus
use new access token thingy
This commit is contained in:
parent
d34b5a2f3b
commit
e8de3985a9
3 changed files with 12 additions and 17 deletions
|
|
@ -105,9 +105,9 @@ class ClientController extends AsyncNotifier<int> {
|
|||
}
|
||||
|
||||
Future<dynamic> _sendCommand(
|
||||
String command,
|
||||
Map<String, dynamic> data,
|
||||
) async {
|
||||
String command, [
|
||||
Map<String, dynamic> data = const {},
|
||||
]) async {
|
||||
final bufferPointer = data.toGomuksBufferPtr();
|
||||
final handle = await future;
|
||||
final response = await Isolate.run(
|
||||
|
|
@ -145,6 +145,11 @@ class ClientController extends AsyncNotifier<int> {
|
|||
return response["room_id"];
|
||||
}
|
||||
|
||||
Future<String?> getAccessToken() async {
|
||||
final response = await _sendCommand("get_account_info", {});
|
||||
return response["access_token"];
|
||||
}
|
||||
|
||||
Future<void> leaveRoom(Room room) async {
|
||||
if (room.metadata == null) return;
|
||||
await _sendCommand("leave_room", {"room_id": room.metadata!.id});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue