mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 16:42:44 +02:00
Fix build errors.
This commit is contained in:
@@ -36,9 +36,6 @@
|
||||
#import "ThemeService.h"
|
||||
#import "TableViewCellWithPhoneNumberTextField.h"
|
||||
|
||||
#import "GroupsDataSource.h"
|
||||
#import "GroupTableViewCellWithSwitch.h"
|
||||
|
||||
#import "GBDeviceInfo_iOS.h"
|
||||
|
||||
#import "MediaPickerViewController.h"
|
||||
@@ -69,7 +66,6 @@ typedef NS_ENUM(NSUInteger, SECTION_TAG)
|
||||
SECTION_TAG_ADVANCED,
|
||||
SECTION_TAG_ABOUT,
|
||||
SECTION_TAG_LABS,
|
||||
SECTION_TAG_FLAIR,
|
||||
SECTION_TAG_DEACTIVATE_ACCOUNT
|
||||
};
|
||||
|
||||
@@ -188,7 +184,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void);
|
||||
|
||||
#pragma mark - SettingsViewController
|
||||
|
||||
@interface SettingsViewController () <UITextFieldDelegate, MXKCountryPickerViewControllerDelegate, MXKLanguagePickerViewControllerDelegate, MXKDataSourceDelegate, DeactivateAccountViewControllerDelegate,
|
||||
@interface SettingsViewController () <UITextFieldDelegate, MXKCountryPickerViewControllerDelegate, MXKLanguagePickerViewControllerDelegate, DeactivateAccountViewControllerDelegate,
|
||||
NotificationSettingsCoordinatorBridgePresenterDelegate,
|
||||
SecureBackupSetupCoordinatorBridgePresenterDelegate,
|
||||
SignOutAlertPresenterDelegate,
|
||||
@@ -229,9 +225,6 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
|
||||
CountryPickerViewController *newPhoneNumberCountryPicker;
|
||||
NBPhoneNumber *newPhoneNumber;
|
||||
|
||||
// Flair: the groups data source
|
||||
GroupsDataSource *groupsDataSource;
|
||||
|
||||
// Observe kAppDelegateDidTapStatusBarNotification to handle tap on clock status bar.
|
||||
__weak id kAppDelegateDidTapStatusBarNotificationObserver;
|
||||
|
||||
@@ -600,19 +593,6 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
|
||||
}
|
||||
}
|
||||
|
||||
if ([groupsDataSource numberOfSectionsInTableView:self.tableView] && groupsDataSource.joinedGroupsSection != -1)
|
||||
{
|
||||
NSInteger count = [groupsDataSource tableView:self.tableView
|
||||
numberOfRowsInSection:groupsDataSource.joinedGroupsSection];
|
||||
Section *sectionFlair = [Section sectionWithTag:SECTION_TAG_FLAIR];
|
||||
for (NSInteger index = 0; index < count; index++)
|
||||
{
|
||||
[sectionFlair addRowWithTag:index];
|
||||
}
|
||||
sectionFlair.headerTitle = [VectorL10n settingsFlair];
|
||||
[tmpSections addObject:sectionFlair];
|
||||
}
|
||||
|
||||
if (BuildSettings.settingsScreenAllowDeactivatingAccount)
|
||||
{
|
||||
Section *sectionDeactivate = [Section sectionWithTag:SECTION_TAG_DEACTIVATE_ACCOUNT];
|
||||
@@ -637,7 +617,6 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
|
||||
[self.tableView registerClass:MXKTableViewCellWithLabelAndSwitch.class forCellReuseIdentifier:[MXKTableViewCellWithLabelAndSwitch defaultReuseIdentifier]];
|
||||
[self.tableView registerClass:MXKTableViewCellWithLabelAndMXKImageView.class forCellReuseIdentifier:[MXKTableViewCellWithLabelAndMXKImageView defaultReuseIdentifier]];
|
||||
[self.tableView registerClass:TableViewCellWithPhoneNumberTextField.class forCellReuseIdentifier:[TableViewCellWithPhoneNumberTextField defaultReuseIdentifier]];
|
||||
[self.tableView registerClass:GroupTableViewCellWithSwitch.class forCellReuseIdentifier:[GroupTableViewCellWithSwitch defaultReuseIdentifier]];
|
||||
[self.tableView registerNib:MXKTableViewCellWithTextView.nib forCellReuseIdentifier:[MXKTableViewCellWithTextView defaultReuseIdentifier]];
|
||||
[self.tableView registerNib:SectionFooterView.nib forHeaderFooterViewReuseIdentifier:[SectionFooterView defaultReuseIdentifier]];
|
||||
|
||||
@@ -694,10 +673,6 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
|
||||
}
|
||||
|
||||
[self setupDiscoverySection];
|
||||
|
||||
groupsDataSource = [[GroupsDataSource alloc] initWithMatrixSession:self.mainSession];
|
||||
[groupsDataSource finalizeInitialization];
|
||||
groupsDataSource.delegate = self;
|
||||
|
||||
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave target:self action:@selector(onSave:)];
|
||||
self.navigationItem.rightBarButtonItem.accessibilityIdentifier=@"SettingsVCNavBarSaveButton";
|
||||
@@ -753,13 +728,6 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
|
||||
|
||||
- (void)destroy
|
||||
{
|
||||
if (groupsDataSource)
|
||||
{
|
||||
groupsDataSource.delegate = nil;
|
||||
[groupsDataSource destroy];
|
||||
groupsDataSource = nil;
|
||||
}
|
||||
|
||||
// Release the potential pushed view controller
|
||||
[self releasePushedViewController];
|
||||
|
||||
@@ -2556,32 +2524,6 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
|
||||
cell = [self buildLiveLocationSharingCellForTableView:tableView atIndexPath:indexPath];
|
||||
}
|
||||
}
|
||||
else if (section == SECTION_TAG_FLAIR)
|
||||
{
|
||||
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:row inSection:groupsDataSource.joinedGroupsSection];
|
||||
cell = [groupsDataSource tableView:tableView cellForRowAtIndexPath:indexPath];
|
||||
|
||||
if ([cell isKindOfClass:GroupTableViewCellWithSwitch.class])
|
||||
{
|
||||
GroupTableViewCellWithSwitch* groupWithSwitchCell = (GroupTableViewCellWithSwitch*)cell;
|
||||
id<MXKGroupCellDataStoring> groupCellData = [groupsDataSource cellDataAtIndex:indexPath];
|
||||
|
||||
// Display the groupId in the description label, except if the group has no name
|
||||
if (![groupWithSwitchCell.groupName.text isEqualToString:groupCellData.group.groupId])
|
||||
{
|
||||
groupWithSwitchCell.groupDescription.hidden = NO;
|
||||
groupWithSwitchCell.groupDescription.text = groupCellData.group.groupId;
|
||||
}
|
||||
|
||||
// Update the toogle button
|
||||
groupWithSwitchCell.toggleButton.on = groupCellData.group.summary.user.isPublicised;
|
||||
groupWithSwitchCell.toggleButton.enabled = YES;
|
||||
groupWithSwitchCell.toggleButton.tag = row;
|
||||
|
||||
[groupWithSwitchCell.toggleButton removeTarget:self action:nil forControlEvents:UIControlEventTouchUpInside];
|
||||
[groupWithSwitchCell.toggleButton addTarget:self action:@selector(toggleCommunityFlair:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
}
|
||||
else if (section == SECTION_TAG_SECURITY)
|
||||
{
|
||||
switch (row)
|
||||
@@ -3326,43 +3268,6 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
|
||||
RiotSettings.shared.pinRoomsWithUnreadMessagesOnHome = sender.on;
|
||||
}
|
||||
|
||||
- (void)toggleCommunityFlair:(UISwitch *)sender
|
||||
{
|
||||
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:sender.tag inSection:groupsDataSource.joinedGroupsSection];
|
||||
id<MXKGroupCellDataStoring> groupCellData = [groupsDataSource cellDataAtIndex:indexPath];
|
||||
MXGroup *group = groupCellData.group;
|
||||
|
||||
if (group)
|
||||
{
|
||||
[self startActivityIndicator];
|
||||
|
||||
__weak typeof(self) weakSelf = self;
|
||||
|
||||
[self.mainSession updateGroupPublicity:group isPublicised:sender.isOn success:^{
|
||||
|
||||
if (weakSelf)
|
||||
{
|
||||
typeof(self) self = weakSelf;
|
||||
[self stopActivityIndicator];
|
||||
}
|
||||
|
||||
} failure:^(NSError *error) {
|
||||
|
||||
if (weakSelf)
|
||||
{
|
||||
typeof(self) self = weakSelf;
|
||||
[self stopActivityIndicator];
|
||||
|
||||
// Come back to previous state button
|
||||
[sender setOn:!sender.isOn animated:YES];
|
||||
|
||||
// Notify user
|
||||
[[AppDelegate theDelegate] showErrorAsAlert:error];
|
||||
}
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)toggleUseOnlyLatestUserAvatarAndName:(UISwitch *)sender
|
||||
{
|
||||
RiotSettings.shared.roomScreenUseOnlyLatestUserAvatarAndName = sender.isOn;
|
||||
@@ -4170,25 +4075,6 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - MXKDataSourceDelegate
|
||||
|
||||
- (Class<MXKCellRendering>)cellViewClassForCellData:(MXKCellData*)cellData
|
||||
{
|
||||
// Return the class used to display a group with a toogle button
|
||||
return GroupTableViewCellWithSwitch.class;
|
||||
}
|
||||
|
||||
- (NSString *)cellReuseIdentifierForCellData:(MXKCellData*)cellData
|
||||
{
|
||||
return GroupTableViewCellWithSwitch.defaultReuseIdentifier;
|
||||
}
|
||||
|
||||
- (void)dataSource:(MXKDataSource *)dataSource didCellChange:(id)changes
|
||||
{
|
||||
// Group data has been updated. Do a simple full reload
|
||||
[self refreshSettings];
|
||||
}
|
||||
|
||||
#pragma mark - DeactivateAccountViewControllerDelegate
|
||||
|
||||
- (void)deactivateAccountViewControllerDidDeactivateWithSuccess:(DeactivateAccountViewController *)deactivateAccountViewController
|
||||
|
||||
Reference in New Issue
Block a user