enable group, show accessible users and peers

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2023-09-14 10:17:03 +08:00
parent 09d380ba8f
commit b2a4f11e0b
53 changed files with 568 additions and 273 deletions

View File

@@ -98,7 +98,8 @@ class PlatformFFI {
int getRgbaSize(SessionID sessionId) =>
_ffiBind.sessionGetRgbaSize(sessionId: sessionId);
void nextRgba(SessionID sessionId) => _ffiBind.sessionNextRgba(sessionId: sessionId);
void nextRgba(SessionID sessionId) =>
_ffiBind.sessionNextRgba(sessionId: sessionId);
void registerTexture(SessionID sessionId, int ptr) =>
_ffiBind.sessionRegisterTexture(sessionId: sessionId, ptr: ptr);
@@ -198,7 +199,7 @@ class PlatformFFI {
version = await getVersion();
}
Future<bool> _tryHandle(Map<String, dynamic> evt) async {
Future<bool> tryHandle(Map<String, dynamic> evt) async {
final name = evt['name'];
if (name != null) {
final handlers = _eventHandlers[name];
@@ -216,14 +217,15 @@ class PlatformFFI {
/// Start listening to the Rust core's events and frames.
void _startListenEvent(RustdeskImpl rustdeskImpl) {
final appType = _appType == kAppTypeDesktopRemote ? '$_appType,$kWindowId' : _appType;
final appType =
_appType == kAppTypeDesktopRemote ? '$_appType,$kWindowId' : _appType;
var sink = rustdeskImpl.startGlobalEventStream(appType: appType);
sink.listen((message) {
() async {
try {
Map<String, dynamic> event = json.decode(message);
// _tryHandle here may be more flexible than _eventCallback
if (!await _tryHandle(event)) {
if (!await tryHandle(event)) {
if (_eventCallback != null) {
await _eventCallback!(event);
}