ab: sync all recent peers if option enabled

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2023-08-16 08:59:50 +08:00
parent 29c661d919
commit 553a3798a1
42 changed files with 183 additions and 96 deletions

View File

@@ -1,6 +1,8 @@
import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'platform_model.dart';
// ignore: depend_on_referenced_packages
import 'package:collection/collection.dart';
class Peer {
final String id;
@@ -87,6 +89,18 @@ class Peer {
rdpPort: '',
rdpUsername: '',
);
bool equal(Peer other) {
return id == other.id &&
hash == other.hash &&
username == other.username &&
hostname == other.hostname &&
platform == other.platform &&
alias == other.alias &&
tags.equals(other.tags) &&
forceAlwaysRelay == other.forceAlwaysRelay &&
rdpPort == other.rdpPort &&
rdpUsername == other.rdpUsername;
}
}
enum UpdateEvent { online, load }