Merge branch 'main' of https://gitlab.com/famedly/famedlysdk into yiffed
This commit is contained in:
commit
d9bc92d654
|
@ -21,7 +21,7 @@ class OneTimeKeysClaimResponse {
|
||||||
Map<String, Map<String, dynamic>> oneTimeKeys;
|
Map<String, Map<String, dynamic>> oneTimeKeys;
|
||||||
|
|
||||||
OneTimeKeysClaimResponse.fromJson(Map<String, dynamic> json) {
|
OneTimeKeysClaimResponse.fromJson(Map<String, dynamic> json) {
|
||||||
failures = Map<String, dynamic>.from(json['failures']);
|
failures = Map<String, dynamic>.from(json['failures'] ?? {});
|
||||||
oneTimeKeys = Map<String, Map<String, dynamic>>.from(json['one_time_keys']);
|
oneTimeKeys = Map<String, Map<String, dynamic>>.from(json['one_time_keys']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -533,10 +533,6 @@ class Client extends MatrixApi {
|
||||||
final StreamController<LoginState> onLoginStateChanged =
|
final StreamController<LoginState> onLoginStateChanged =
|
||||||
StreamController.broadcast();
|
StreamController.broadcast();
|
||||||
|
|
||||||
/// Synchronization erros are coming here.
|
|
||||||
final StreamController<MatrixException> onError =
|
|
||||||
StreamController.broadcast();
|
|
||||||
|
|
||||||
/// Synchronization erros are coming here.
|
/// Synchronization erros are coming here.
|
||||||
final StreamController<SdkError> onSyncError = StreamController.broadcast();
|
final StreamController<SdkError> onSyncError = StreamController.broadcast();
|
||||||
|
|
||||||
|
@ -780,18 +776,17 @@ class Client extends MatrixApi {
|
||||||
encryption.onSync();
|
encryption.onSync();
|
||||||
}
|
}
|
||||||
_retryDelay = Future.value();
|
_retryDelay = Future.value();
|
||||||
} on MatrixException catch (e) {
|
} on MatrixException catch (e, s) {
|
||||||
onError.add(e);
|
onSyncError.add(SdkError(exception: e, stackTrace: s));
|
||||||
|
if (e.error == MatrixError.M_UNKNOWN_TOKEN) {
|
||||||
|
Logs.warning('The user has been logged out!');
|
||||||
|
clear();
|
||||||
|
}
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
if (!isLogged() || _disposed) return;
|
if (!isLogged() || _disposed) return;
|
||||||
Logs.error('Error during processing events: ' + e.toString(), s);
|
Logs.error('Error during processing events: ' + e.toString(), s);
|
||||||
onSyncError.add(SdkError(
|
onSyncError.add(SdkError(
|
||||||
exception: e is Exception ? e : Exception(e), stackTrace: s));
|
exception: e is Exception ? e : Exception(e), stackTrace: s));
|
||||||
if (e is MatrixException &&
|
|
||||||
e.errcode == MatrixError.M_UNKNOWN_TOKEN.toString().split('.').last) {
|
|
||||||
Logs.warning('The user has been logged out!');
|
|
||||||
clear();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue