Take into account the identity server when setting the default value of showLocalContacts.

This commit is contained in:
Doug
2021-08-10 12:03:28 +01:00
parent 3d958d95c2
commit 82cb8bc488
@@ -80,7 +80,6 @@
_areSectionsShrinkable = NO;
shrinkedSectionsBitMask = 0;
_showLocalContacts = MXKAppSettings.standardAppSettings.syncLocalContacts;
hideNonMatrixEnabledContacts = NO;
_displaySearchInputInContactsList = NO;
@@ -93,6 +92,16 @@
return self;
}
- (instancetype)initWithMatrixSession:(MXSession *)mxSession
{
self = [super initWithMatrixSession:mxSession];
if (self) {
// Only show local contacts when contact sync is enabled and the identity server terms of service have been accepted.
_showLocalContacts = MXKAppSettings.standardAppSettings.syncLocalContacts && self.mxSession.hasAccountDataIdentityServerValue;
}
return self;
}
- (void)destroy
{
[[NSNotificationCenter defaultCenter] removeObserver:self name:kMXKContactManagerDidUpdateMatrixContactsNotification object:nil];