|
|
@ -417,9 +417,10 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void didChangeAppLifecycleState(AppLifecycleState state) {
|
|
|
|
void didChangeAppLifecycleState(AppLifecycleState state) {
|
|
|
|
Logs().v('AppLifecycleState = $state');
|
|
|
|
Logs().v('AppLifecycleState = $state');
|
|
|
|
final foreground = state != AppLifecycleState.detached &&
|
|
|
|
final foreground =
|
|
|
|
state != AppLifecycleState.paused;
|
|
|
|
state != AppLifecycleState.resumed && state != AppLifecycleState.paused;
|
|
|
|
client.syncPresence = foreground ? null : PresenceType.unavailable;
|
|
|
|
client.syncPresence =
|
|
|
|
|
|
|
|
state == AppLifecycleState.resumed ? null : PresenceType.unavailable;
|
|
|
|
if (PlatformInfos.isMobile) {
|
|
|
|
if (PlatformInfos.isMobile) {
|
|
|
|
client.backgroundSync = foreground;
|
|
|
|
client.backgroundSync = foreground;
|
|
|
|
client.requestHistoryOnLimitedTimeline = !foreground;
|
|
|
|
client.requestHistoryOnLimitedTimeline = !foreground;
|
|
|
|