Skip to content

Commit

Permalink
De-labs use only latest user avatar and name
Browse files Browse the repository at this point in the history
  • Loading branch information
aringenbach committed Jun 20, 2022
1 parent a8e7bf9 commit a6df2b3
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 24 deletions.
1 change: 1 addition & 0 deletions Riot/Assets/en.lproj/Vector.strings
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ Tap the + to start adding people.";
"settings_identity_server_settings" = "IDENTITY SERVER";
"settings_integrations" = "INTEGRATIONS";
"settings_user_interface" = "USER INTERFACE";
"settings_timeline" = "TIMELINE";
"settings_ignored_users" = "IGNORED USERS";
"settings_contacts" = "DEVICE CONTACTS";
"settings_phone_contacts" = "PHONE CONTACTS";
Expand Down
4 changes: 4 additions & 0 deletions Riot/Generated/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7135,6 +7135,10 @@ public class VectorL10n: NSObject {
public static var settingsThreePidsManagementInformationPart3: String {
return VectorL10n.tr("Vector", "settings_three_pids_management_information_part3")
}
/// TIMELINE
public static var settingsTimeline: String {
return VectorL10n.tr("Vector", "settings_timeline")
}
/// Settings
public static var settingsTitle: String {
return VectorL10n.tr("Vector", "settings_title")
Expand Down
61 changes: 37 additions & 24 deletions Riot/Modules/Settings/SettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ typedef NS_ENUM(NSUInteger, SECTION_TAG)
SECTION_TAG_IGNORED_USERS,
SECTION_TAG_INTEGRATIONS,
SECTION_TAG_USER_INTERFACE,
SECTION_TAG_TIMELINE,
SECTION_TAG_PRESENCE,
SECTION_TAG_ADVANCED,
SECTION_TAG_ABOUT,
Expand Down Expand Up @@ -129,9 +130,14 @@ typedef NS_ENUM(NSUInteger, LOCAL_CONTACTS)
typedef NS_ENUM(NSUInteger, USER_INTERFACE)
{
USER_INTERFACE_LANGUAGE_INDEX = 0,
USER_INTERFACE_THEME_INDEX,
USER_INTERFACE_TIMELINE_STYLE_INDEX,
USER_INTERFACE_SHOW_REDACTIONS_IN_ROOM_HISTORY
USER_INTERFACE_THEME_INDEX
};

typedef NS_ENUM(NSUInteger, TIMELINE)
{
TIMELINE_STYLE_INDEX,
TIMELINE_SHOW_REDACTIONS_IN_ROOM_HISTORY_INDEX,
TIMELINE_USE_ONLY_LATEST_USER_AVATAR_AND_NAME_INDEX
};

typedef NS_ENUM(NSUInteger, IDENTITY_SERVER)
Expand Down Expand Up @@ -167,7 +173,6 @@ typedef NS_ENUM(NSUInteger, LABS_ENABLE)
LABS_ENABLE_RINGING_FOR_GROUP_CALLS_INDEX = 0,
LABS_ENABLE_THREADS_INDEX,
LABS_ENABLE_AUTO_REPORT_DECRYPTION_ERRORS,
LABS_USE_ONLY_LATEST_USER_AVATAR_AND_NAME_INDEX,
LABS_ENABLE_LIVE_LOCATION_SHARING
};

Expand Down Expand Up @@ -511,15 +516,20 @@ - (void)updateSections

[sectionUserInterface addRowWithTag:USER_INTERFACE_LANGUAGE_INDEX];
[sectionUserInterface addRowWithTag:USER_INTERFACE_THEME_INDEX];


[tmpSections addObject:sectionUserInterface];

Section *sectionTimeline = [Section sectionWithTag:SECTION_TAG_TIMELINE];
sectionTimeline.headerTitle = VectorL10n.settingsTimeline;

if (BuildSettings.roomScreenAllowTimelineStyleConfiguration)
{
[sectionUserInterface addRowWithTag:USER_INTERFACE_TIMELINE_STYLE_INDEX];
[sectionTimeline addRowWithTag:TIMELINE_STYLE_INDEX];
}
[sectionTimeline addRowWithTag:TIMELINE_SHOW_REDACTIONS_IN_ROOM_HISTORY_INDEX];
[sectionTimeline addRowWithTag:TIMELINE_USE_ONLY_LATEST_USER_AVATAR_AND_NAME_INDEX];

[sectionUserInterface addRowWithTag:USER_INTERFACE_SHOW_REDACTIONS_IN_ROOM_HISTORY];

[tmpSections addObject: sectionUserInterface];
[tmpSections addObject:sectionTimeline];

if(BuildSettings.settingsScreenPresenceAllowConfiguration)
{
Expand Down Expand Up @@ -585,7 +595,6 @@ - (void)updateSections
[sectionLabs addRowWithTag:LABS_ENABLE_RINGING_FOR_GROUP_CALLS_INDEX];
[sectionLabs addRowWithTag:LABS_ENABLE_THREADS_INDEX];
[sectionLabs addRowWithTag:LABS_ENABLE_AUTO_REPORT_DECRYPTION_ERRORS];
[sectionLabs addRowWithTag:LABS_USE_ONLY_LATEST_USER_AVATAR_AND_NAME_INDEX];
if (BuildSettings.liveLocationSharingEnabled)
{
// Hide live location lab setting until it's ready to be release
Expand Down Expand Up @@ -2259,11 +2268,14 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
[cell vc_setAccessoryDisclosureIndicatorWithCurrentTheme];
cell.selectionStyle = UITableViewCellSelectionStyleDefault;
}
else if (row == USER_INTERFACE_TIMELINE_STYLE_INDEX)
}
else if (section == SECTION_TAG_TIMELINE)
{
if (row == TIMELINE_STYLE_INDEX)
{
cell = [self buildMessageBubblesCellForTableView:tableView atIndexPath:indexPath];
}
else if (row == USER_INTERFACE_SHOW_REDACTIONS_IN_ROOM_HISTORY)
else if (row == TIMELINE_SHOW_REDACTIONS_IN_ROOM_HISTORY_INDEX)
{
MXKTableViewCellWithLabelAndSwitch* labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];

Expand All @@ -2274,6 +2286,19 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
labelAndSwitchCell.mxkSwitch.enabled = YES;
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleShowRedacted:) forControlEvents:UIControlEventTouchUpInside];

cell = labelAndSwitchCell;
}
else if (row == TIMELINE_USE_ONLY_LATEST_USER_AVATAR_AND_NAME_INDEX)
{
MXKTableViewCellWithLabelAndSwitch *labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];

labelAndSwitchCell.mxkLabel.text = VectorL10n.settingsLabsUseOnlyLatestUserAvatarAndName;
labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.roomScreenUseOnlyLatestUserAvatarAndName;
labelAndSwitchCell.mxkSwitch.enabled = YES;
labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor;

[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleUseOnlyLatestUserAvatarAndName:) forControlEvents:UIControlEventTouchUpInside];

cell = labelAndSwitchCell;
}
}
Expand Down Expand Up @@ -2527,18 +2552,6 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
{
cell = [self buildAutoReportDecryptionErrorsCellForTableView:tableView atIndexPath:indexPath];
}
else if (row == LABS_USE_ONLY_LATEST_USER_AVATAR_AND_NAME_INDEX)
{
MXKTableViewCellWithLabelAndSwitch *labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];

labelAndSwitchCell.mxkLabel.text = VectorL10n.settingsLabsUseOnlyLatestUserAvatarAndName;
labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.roomScreenUseOnlyLatestUserAvatarAndName;
labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor;

[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleUseOnlyLatestUserAvatarAndName:) forControlEvents:UIControlEventTouchUpInside];

cell = labelAndSwitchCell;
}
else if (row == LABS_ENABLE_LIVE_LOCATION_SHARING)
{
cell = [self buildLiveLocationSharingCellForTableView:tableView atIndexPath:indexPath];
Expand Down
1 change: 1 addition & 0 deletions changelog.d/6312.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
De-labs use only latest user avatar and name

0 comments on commit a6df2b3

Please sign in to comment.