From c72d8913b8ba074a5b6d326a0ac1975eea37f7b6 Mon Sep 17 00:00:00 2001 From: Benoit Martins Date: Thu, 10 Nov 2022 10:52:56 +0100 Subject: [PATCH] Add a new button in the account link popup to never ask again user to link his account --- Classes/LinphoneManager.m | 13 ++++++++++++- Resources/ar.lproj/Localizable.strings | Bin 74146 -> 74306 bytes Resources/de.lproj/Localizable.strings | Bin 81676 -> 81834 bytes Resources/en.lproj/Localizable.strings | Bin 52874 -> 52952 bytes Resources/fr.lproj/Localizable.strings | Bin 72862 -> 72948 bytes Resources/ja.lproj/Localizable.strings | Bin 72318 -> 72460 bytes Resources/nl.lproj/Localizable.strings | Bin 78516 -> 78674 bytes Resources/ru.lproj/Localizable.strings | Bin 87372 -> 87554 bytes 8 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index b57cdea73..b1c2b8654 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -278,6 +278,10 @@ struct codec_name_pref_table codec_pref_table[] = {{"speex", 8000, "speex_8k_pre [self lpConfigSetString:@"conflate" forKey:@"handle_content_encoding" inSection:@"misc"]; #endif } + + if ([self lpConfigStringForKey:@"display_link_account_popup"] == nil) { + [self lpConfigSetBool:true forKey:@"display_link_account_popup"]; + } [self migrateFromUserPrefs]; [self loadAvatar]; @@ -1282,7 +1286,14 @@ void popup_link_account_cb(LinphoneAccountCreator *creator, LinphoneAccountCreat handler:^(UIAlertAction * action) { [PhoneMainView.instance changeCurrentView:AssistantLinkView.compositeViewDescription]; }]; + + UIAlertAction* otherAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Never ask again", nil) + style:UIAlertActionStyleDefault + handler:^(UIAlertAction * action) { + [LinphoneManager.instance lpConfigSetBool:false forKey:@"display_link_account_popup"]; + }]; defaultAction.accessibilityLabel = @"Later"; + [errView addAction:otherAction]; [errView addAction:defaultAction]; [errView addAction:continueAction]; [PhoneMainView.instance presentViewController:errView animated:YES completion:nil]; @@ -1301,7 +1312,7 @@ void popup_link_account_cb(LinphoneAccountCreator *creator, LinphoneAccountCreat NSDate *nextTime = [NSDate dateWithTimeIntervalSince1970:[self lpConfigIntForKey:@"must_link_account_time" withDefault:1]]; NSDate *now = [NSDate date]; - if (nextTime.timeIntervalSince1970 > 0 && [now earlierDate:nextTime] == nextTime) { + if (nextTime.timeIntervalSince1970 > 0 && [now earlierDate:nextTime] == nextTime && [LinphoneManager.instance lpConfigBoolForKey:@"display_link_account_popup"]) { LinphoneAccount *account = linphone_core_get_default_account(LC); if (account) { const char *username = linphone_address_get_username(linphone_account_params_get_identity_address(linphone_account_get_params(account))); diff --git a/Resources/ar.lproj/Localizable.strings b/Resources/ar.lproj/Localizable.strings index d69c5259e445ca28ffd8aa2877bbc3ec31537d85..dee4fd811aa54ed77f3327ff341b85389333f4e6 100644 GIT binary patch delta 80 zcmZ24vB?cEZS2hI( dH#T!N7dDN_iOYp2PvVc5tXIjkc|y6+DgcDc6&3&h delta 18 acmX?fgk{lTmJMy?lh0LhZ8oS7S_J@CnFyQ! diff --git a/Resources/de.lproj/Localizable.strings b/Resources/de.lproj/Localizable.strings index 793489891deef32a4ca87b8922017fe6f8f5da30..9b8205ba47223be37d9ed008f498ffaec58e0a10 100644 GIT binary patch delta 97 zcmeDA$Fk}_%Z98vM?Z#ChB6>7Vo+d6WGH6H2Gi+4b|ym}gA$Nu3&ctcZa@`@4Cz32 k9#AF~NSA}@l*x`Zv6CI@jiwjqGjdI?Y2w9CcmiHn9gUw$TeB2nQOCOeary>?UW6f diff --git a/Resources/en.lproj/Localizable.strings b/Resources/en.lproj/Localizable.strings index 76f33d13e5ef9b0b98da692eded9ac33c05d1570..7d43918de1463dd24e2c7d46a87ca2445046ebfb 100644 GIT binary patch delta 88 zcmeC0%Y0)l^M-qVu6_)u3}rxE#Gt^C$WY9X4W`q9>`aC{1|=ZR7KoJ?@T!~a?QgwV Iz`v><0HYZb_5c6? delta 18 acmcaHm$_>$^M-qVlNb3LZI1J=ss{j6ZwQV6 diff --git a/Resources/fr.lproj/Localizable.strings b/Resources/fr.lproj/Localizable.strings index 1efbd414787b563341af89ef7cd102c43d70c1bc..f1cf0bdecfb5b5e471bfc22f04d917a5ed492633 100644 GIT binary patch delta 88 zcmbQYljX}!mJO>?Jj)nT8HyMb7!nzZ8M482I*^^okjJ0|eJ bP?Z8hE|{MJBy)jk^B6#^qRn$t7?Hl=>q4gfQ32aNy# diff --git a/Resources/ja.lproj/Localizable.strings b/Resources/ja.lproj/Localizable.strings index 7ceeeff94277b434bf7b16b72deffcb17ceb55c0..7d2acb02c97d9b703ecea81bed55b2cf71419744 100644 GIT binary patch delta 73 zcmeyjg{5a3%LcQONu4bEWelkdMGOiIi44UI*`aC{1|=ZR7KoJ?aH^Z!$R0a+ MK`qy2fvP1t0JPW@egFUf delta 18 acmccgjAhGHmJMuGlkMubHm|E%vI78DRtXva diff --git a/Resources/ru.lproj/Localizable.strings b/Resources/ru.lproj/Localizable.strings index 86adb20af64a175688812dd70f5cf46bc6267f82..70671d7d9ee38bfc66653b38c59474f3bda86756 100644 GIT binary patch delta 94 zcmX@JinVDC>xQurhjbLJh~}2~~S;0RTNd7aafq delta 14 WcmZo#!+K^F>xQ