Skip to content

Commit

Permalink
Améliorer la compréhension du fonctionnement des notifications par email
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Buquet committed Apr 30, 2024
1 parent 7d5b83d commit cd199ec
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
39 changes: 38 additions & 1 deletion Riot/Modules/Settings/SettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -2241,7 +2241,34 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
{
MXKTableViewCellWithLabelAndSwitch* labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];

labelAndSwitchCell.mxkLabel.text = TchapL10n.settingsNotificationEmail;


// Tchap: add explanation to "enable notiofications by email"
// labelAndSwitchCell.mxkLabel.text = TchapL10n.settingsNotificationEmail;

NSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc] initWithString: TchapL10n.settingsNotificationEmail
attributes:@{NSForegroundColorAttributeName : ThemeService.shared.theme.textPrimaryColor,
NSFontAttributeName: [UIFont systemFontOfSize:17.0]}];
[attributedText appendAttributedString:[[NSAttributedString alloc] initWithString:@"\n\n" attributes:@{NSFontAttributeName: [UIFont systemFontOfSize:4]}]];
[attributedText appendAttributedString:[[NSMutableAttributedString alloc] initWithString: TchapL10n.settingsEnableEmailNotifText
attributes:@{NSForegroundColorAttributeName : ThemeService.shared.theme.textSecondaryColor,
NSFontAttributeName: [UIFont systemFontOfSize:14.0]}]];

[attributedText appendString:@" "];

[attributedText appendAttributedString:
[[NSAttributedString alloc] initWithString:TchapL10n.settingsEnableEmailNotifLink
attributes:@{
NSForegroundColorAttributeName: ThemeService.shared.theme.textSecondaryColor,
NSFontAttributeName: [UIFont systemFontOfSize:14.0],
NSUnderlineStyleAttributeName: [NSNumber numberWithInt:NSUnderlineStyleSingle]
}]];

labelAndSwitchCell.mxkLabel.attributedText = attributedText;

[labelAndSwitchCell.mxkLabel addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(displayEmailNotificationFaq)]];
labelAndSwitchCell.mxkLabel.userInteractionEnabled = YES;

labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor;
labelAndSwitchCell.mxkSwitch.enabled = YES;
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleNotificationsByEmail:) forControlEvents:UIControlEventTouchUpInside];
Expand Down Expand Up @@ -5127,4 +5154,14 @@ - (void)showUserSessionsFlow
// MXLogWarning(@"Unexpected callback after OIDC account management.")
//}

// Tchap: display email notification faq
- (void)displayEmailNotificationFaq {
NSLog(@"activateHyperlinkURL");

NSString *targetUrlString = @"https://aide.tchap.beta.gouv.fr/fr/article/notification-par-email-draft-6k7k89/";

WebSheetViewController *webCtrl = [[WebSheetViewController alloc] initWithTargetUrl:[NSURL URLWithString:targetUrlString]];
[self presentViewController:webCtrl animated:YES completion:nil];
}

@end
2 changes: 2 additions & 0 deletions Tchap/Assets/Localizations/fr.lproj/Tchap.strings
Original file line number Diff line number Diff line change
Expand Up @@ -347,3 +347,5 @@
////////////////////////////////////////////////////////////////////////////////
// MARK: Settings
"settings_enable_push_notif_text" = "Sans cette autorisation, les appels entrants ne seront pas notifiés.";
"settings_enable_email_notif_text" = "Recevez un e-mail si au moins un message récent non lu pendant 72h.";
"settings_enable_email_notif_link" = "En savoir plus.";
1 change: 1 addition & 0 deletions changelog.d/1029.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Améliorer la compréhension du fonctionnement des notifications par email.

0 comments on commit cd199ec

Please sign in to comment.