Merge pull request #5865 from vector-im/ismail/5770_threads_notice

Threads notice
This commit is contained in:
ismailgulek
2022-03-31 13:18:40 +03:00
committed by GitHub
9 changed files with 345 additions and 1 deletions
+35
View File
@@ -210,6 +210,7 @@ static CGSize kThreadListBarButtonItemImageSize;
@property (nonatomic, strong) CustomSizedPresentationController *customSizedPresentationController;
@property (nonatomic, strong) RoomParticipantsInviteCoordinatorBridgePresenter *participantsInvitePresenter;
@property (nonatomic, strong) ThreadsCoordinatorBridgePresenter *threadsBridgePresenter;
@property (nonatomic, strong) SlidingModalPresenter *threadsNoticeModalPresenter;
@property (nonatomic, getter=isActivitiesViewExpanded) BOOL activitiesViewExpanded;
@property (nonatomic, getter=isScrollToBottomHidden) BOOL scrollToBottomHidden;
@property (nonatomic, getter=isMissedDiscussionsBadgeHidden) BOOL missedDiscussionsBadgeHidden;
@@ -658,6 +659,11 @@ static CGSize kThreadListBarButtonItemImageSize;
}
self.showSettingsInitially = NO;
if (!RiotSettings.shared.threadsNoticeDisplayed && RiotSettings.shared.enableThreads)
{
[self showThreadsNotice];
}
}
- (void)viewDidDisappear:(BOOL)animated
@@ -6778,6 +6784,35 @@ static CGSize kThreadListBarButtonItemImageSize;
#pragma mark - Threads
- (void)showThreadsNotice
{
if (!self.threadsNoticeModalPresenter)
{
self.threadsNoticeModalPresenter = [SlidingModalPresenter new];
}
[self.threadsNoticeModalPresenter dismissWithAnimated:NO completion:nil];
ThreadsNoticeViewController *threadsNoticeVC = [ThreadsNoticeViewController instantiate];
MXWeakify(self);
threadsNoticeVC.didTapDoneButton = ^{
MXStrongifyAndReturnIfNil(self);
[self.threadsNoticeModalPresenter dismissWithAnimated:YES completion:^{
RiotSettings.shared.threadsNoticeDisplayed = YES;
}];
};
[self.threadsNoticeModalPresenter present:threadsNoticeVC
from:self.presentedViewController?:self
animated:YES
options:SlidingModalPresenter.SpanningOption
completion:nil];
}
- (void)openThreadWithId:(NSString *)threadId
{
if (self.threadsBridgePresenter)