mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 16:42:44 +02:00
feat: add migration part 1 banner (MESSENGER-7564)
This commit is contained in:
@@ -202,7 +202,7 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
|
||||
{
|
||||
NSMutableArray *types = [NSMutableArray array];
|
||||
// bwi: add new feature banner
|
||||
if (!shouldHideFeatureBanner && BWIBuildSettings.shared.showTopBanner && BWIBuildSettings.shared.isWellknownFederationEnabled){
|
||||
if (!shouldHideFeatureBanner && BWIBuildSettings.shared.showTopBanner && BWIBuildSettings.shared.BuMXMigrationInfoLevel > 0) {
|
||||
[types addObject:@(RecentsDataSourceSectionTypeFeatureBanner)];
|
||||
}
|
||||
|
||||
@@ -1890,17 +1890,18 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
|
||||
|
||||
- (void) shouldShowFeatureBanner
|
||||
{
|
||||
if (BWIBuildSettings.shared.showTopBanner && BWIBuildSettings.shared.isWellknownFederationEnabled){
|
||||
if (BWIBuildSettings.shared.showTopBanner && BWIBuildSettings.shared.BuMXMigrationInfoLevel > 0){
|
||||
MXSession* session = [self mxSession];
|
||||
if(!session)
|
||||
return;
|
||||
NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
|
||||
FeatureBannerVisibilityService *featureBannerService = [[FeatureBannerVisibilityService alloc] initWithMxSession:session];
|
||||
[featureBannerService isUnreadWithVersion:version completion:^(BOOL unread) {
|
||||
[featureBannerService isUnreadWithCompletion: ^(BOOL unread) {
|
||||
if (unread) {
|
||||
// this notification will be called either if the user clicked on the banner or wants to hide it
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:@"de.bwi.messenger.hide_top_banner" object:NULL queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification) {
|
||||
[self markFeatureBannerAsRead];
|
||||
self->shouldHideFeatureBanner = TRUE;
|
||||
[self.delegate dataSource:self didCellChange:nil];
|
||||
//[self markFeatureBannerAsRead];
|
||||
}];
|
||||
|
||||
// this notification will be called either if the user clicked on the banner or wants to hide it using a swipe gesture
|
||||
@@ -1931,9 +1932,8 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
|
||||
MXSession* session = [self mxSession];
|
||||
if(!session)
|
||||
return;
|
||||
NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
|
||||
FeatureBannerVisibilityService *featureBannerService = [[FeatureBannerVisibilityService alloc] initWithMxSession:session];
|
||||
[featureBannerService markAsReadWithVersion:version];
|
||||
[featureBannerService markAsRead];
|
||||
self->shouldHideFeatureBanner = TRUE;
|
||||
[self.delegate dataSource:self didCellChange:nil];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user