Merge pull request #2568 from vector-im/riot_2558

LABS: Remove reaction settings
This commit is contained in:
SBiOSoftWhare
2019-07-09 13:55:01 +02:00
committed by GitHub
4 changed files with 3 additions and 42 deletions
@@ -26,7 +26,6 @@ final class RiotSettings: NSObject {
static let enableCrashReport = "enableCrashReport"
static let enableRageShake = "enableRageShake"
static let createConferenceCallsWithJitsi = "createConferenceCallsWithJitsi"
static let messageReaction = "messageReaction"
static let userInterfaceTheme = "userInterfaceTheme"
static let notificationsShowDecryptedContent = "showDecryptedContent"
static let pinRoomsWithMissedNotifications = "pinRoomsWithMissedNotif"
@@ -120,12 +119,4 @@ final class RiotSettings: NSObject {
UserDefaults.standard.set(newValue, forKey: UserDefaultsKeys.createConferenceCallsWithJitsi)
}
}
var messageReaction: Bool {
get {
return UserDefaults.standard.bool(forKey: UserDefaultsKeys.messageReaction)
} set {
UserDefaults.standard.set(newValue, forKey: UserDefaultsKeys.messageReaction)
}
}
}
@@ -61,7 +61,7 @@
self.markTimelineInitialEvent = NO;
self.showBubbleDateTimeOnSelection = YES;
self.showReactions = RiotSettings.shared.messageReaction;
self.showReactions = YES;
// Observe user interface theme change.
kThemeServiceDidChangeThemeNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kThemeServiceDidChangeThemeNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {
+1 -1
View File
@@ -5157,7 +5157,7 @@
ReactionsMenuViewModel *reactionsMenuViewModel;
CGRect bubbleComponentFrameInOverlayView = CGRectNull;
if (RiotSettings.shared.messageReaction && [cell isKindOfClass:MXKRoomBubbleTableViewCell.class] && [self.roomDataSource canReactToEventWithId:event.eventId])
if ([cell isKindOfClass:MXKRoomBubbleTableViewCell.class] && [self.roomDataSource canReactToEventWithId:event.eventId])
{
MXKRoomBubbleTableViewCell *roomBubbleTableViewCell = (MXKRoomBubbleTableViewCell*)cell;
MXKRoomBubbleCellData *bubbleCellData = roomBubbleTableViewCell.bubbleData;
+1 -31
View File
@@ -120,7 +120,6 @@ enum
{
LABS_USE_ROOM_MEMBERS_LAZY_LOADING_INDEX = 0,
LABS_USE_JITSI_WIDGET_INDEX,
LABS_USE_MESSAGE_REACTION_INDEX,
LABS_CRYPTO_INDEX,
LABS_COUNT
};
@@ -2136,20 +2135,7 @@ SignOutAlertPresenterDelegate>
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleJitsiForConference:) forControlEvents:UIControlEventTouchUpInside];
cell = labelAndSwitchCell;
}
else if (row == LABS_USE_MESSAGE_REACTION_INDEX)
{
MXKTableViewCellWithLabelAndSwitch* labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];
labelAndSwitchCell.mxkLabel.text = NSLocalizedStringFromTable(@"settings_labs_message_reaction", @"Vector", nil);
labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.messageReaction;
labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor;
labelAndSwitchCell.mxkSwitch.enabled = YES;
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleMessageReaction:) forControlEvents:UIControlEventTouchUpInside];
cell = labelAndSwitchCell;
}
}
else if (row == LABS_CRYPTO_INDEX)
{
MXSession* session = [AppDelegate theDelegate].mxSessions[0];
@@ -3049,22 +3035,6 @@ SignOutAlertPresenterDelegate>
}
}
- (void)toggleMessageReaction:(id)sender
{
if (sender && [sender isKindOfClass:UISwitch.class])
{
UISwitch *switchButton = (UISwitch*)sender;
RiotSettings.shared.messageReaction = switchButton.isOn;
// Reset cached room data sources
MXKRoomDataSourceManager *roomDataSourceManager = [MXKRoomDataSourceManager sharedManagerForMatrixSession:self.mainSession];
[roomDataSourceManager reset];
[self.tableView reloadData];
}
}
- (void)toggleLabsEndToEndEncryption:(id)sender
{
if (sender && [sender isKindOfClass:UISwitch.class])