@@ -36,6 +36,7 @@ class ServerModel with ChangeNotifier {
3636 int _connectStatus = 0 ; // Rendezvous Server status
3737 String _verificationMethod = "" ;
3838 String _temporaryPasswordLength = "" ;
39+ bool _allowNumericOneTimePassword = false ;
3940 String _approveMode = "" ;
4041 int _zeroClientLengthCounter = 0 ;
4142
@@ -112,6 +113,12 @@ class ServerModel with ChangeNotifier {
112113 */
113114 }
114115
116+ bool get allowNumericOneTimePassword => _allowNumericOneTimePassword;
117+ switchAllowNumericOneTimePassword () async {
118+ await mainSetBoolOption (
119+ kOptionAllowNumericOneTimePassword, ! _allowNumericOneTimePassword);
120+ }
121+
115122 TextEditingController get serverId => _serverId;
116123
117124 TextEditingController get serverPasswd => _serverPasswd;
@@ -227,6 +234,8 @@ class ServerModel with ChangeNotifier {
227234 final temporaryPasswordLength =
228235 await bind.mainGetOption (key: "temporary-password-length" );
229236 final approveMode = await bind.mainGetOption (key: kOptionApproveMode);
237+ final numericOneTimePassword =
238+ await mainGetBoolOption (kOptionAllowNumericOneTimePassword);
230239 /*
231240 var hideCm = option2bool(
232241 'allow-hide-cm', await bind.mainGetOption(key: 'allow-hide-cm'));
@@ -265,6 +274,10 @@ class ServerModel with ChangeNotifier {
265274 _temporaryPasswordLength = temporaryPasswordLength;
266275 update = true ;
267276 }
277+ if (_allowNumericOneTimePassword != numericOneTimePassword) {
278+ _allowNumericOneTimePassword = numericOneTimePassword;
279+ update = true ;
280+ }
268281 /*
269282 if (_hideCm != hideCm) {
270283 _hideCm = hideCm;
@@ -817,8 +830,8 @@ class Client {
817830
818831 RxInt unreadChatMessageCount = 0. obs;
819832
820- Client (this .id, this .authorized, this .isFileTransfer, this .isViewCamera, this .name, this .peerId,
821- this .keyboard, this .clipboard, this .audio);
833+ Client (this .id, this .authorized, this .isFileTransfer, this .isViewCamera,
834+ this .name, this .peerId, this . keyboard, this .clipboard, this .audio);
822835
823836 Client .fromJson (Map <String , dynamic > json) {
824837 id = json['id' ];
0 commit comments