Merge branch 'develop' into ismail/4384_room_summary_store

This commit is contained in:
ismailgulek
2021-10-19 16:40:34 +03:00
45 changed files with 2019 additions and 1850 deletions
+50 -7
View File
@@ -16,6 +16,8 @@
limitations under the License.
*/
@import MobileCoreServices;
#import "RoomViewController.h"
#import "RoomDataSource.h"
@@ -106,6 +108,7 @@
#import "AvatarGenerator.h"
#import "Tools.h"
#import "WidgetManager.h"
#import "ShareManager.h"
#import "GBDeviceInfo_iOS.h"
@@ -249,6 +252,8 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
@property (nonatomic, strong) VoiceMessageController *voiceMessageController;
@property (nonatomic, strong) SpaceDetailPresenter *spaceDetailPresenter;
@property (nonatomic, strong) ShareManager *shareManager;
@property (nonatomic, strong) UserSuggestionCoordinatorBridge *userSuggestionCoordinator;
@property (nonatomic, weak) IBOutlet UIView *userSuggestionContainerView;
@@ -2394,10 +2399,7 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
// Set a default title view class without handling tap gesture (Let [self refreshRoomTitle] refresh this view correctly).
[self setRoomTitleViewClass:RoomTitleView.class];
// Remove details icon
RoomTitleView *roomTitleView = (RoomTitleView*)self.titleView;
// Remove the shadow image used to hide the bottom border of the navigation bar when the preview header is displayed
[mainNavigationController.navigationBar setShadowImage:nil];
[mainNavigationController.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
@@ -3190,6 +3192,23 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
}]];
}
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionForward]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
self.shareManager = [[ShareManager alloc] initWithShareItemProvider:[[SimpleShareItemProvider alloc] initWithTextMessage:selectedComponent.textMessage]
type:ShareManagerTypeForward];
MXWeakify(self);
[self.shareManager setCompletionCallback:^(ShareManagerResult result) {
MXStrongifyAndReturnIfNil(self);
[attachment onShareEnded];
[self dismissViewControllerAnimated:YES completion:nil];
self.shareManager = nil;
}];
[self presentViewController:self.shareManager.mainViewController animated:YES completion:nil];
}]];
if (!isJitsiCallEvent)
{
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionQuote]
@@ -3243,6 +3262,29 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
}
else // Add action for attachment
{
if (attachment.type == MXKAttachmentTypeFile ||
attachment.type == MXKAttachmentTypeImage ||
attachment.type == MXKAttachmentTypeVideo ||
attachment.type == MXKAttachmentTypeVoiceMessage) {
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionForward]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
self.shareManager = [[ShareManager alloc] initWithShareItemProvider:[[SimpleShareItemProvider alloc] initWithAttachment:attachment]
type:ShareManagerTypeForward];
MXWeakify(self);
[self.shareManager setCompletionCallback:^(ShareManagerResult result) {
MXStrongifyAndReturnIfNil(self);
[attachment onShareEnded];
[self dismissViewControllerAnimated:YES completion:nil];
self.shareManager = nil;
}];
[self presentViewController:self.shareManager.mainViewController animated:YES completion:nil];
}]];
}
if (BuildSettings.messageDetailsAllowSave)
{
if (attachment.type == MXKAttachmentTypeImage || attachment.type == MXKAttachmentTypeVideo)
@@ -3340,7 +3382,10 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
[self cancelEventSelection];
[self startActivityIndicator];
[attachment prepareShare:^(NSURL *fileURL) {
[self stopActivityIndicator];
__strong __typeof(weakSelf)self = weakSelf;
self->documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:fileURL];
@@ -3355,10 +3400,8 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
}
} failure:^(NSError *error) {
//Alert user
[self showError:error];
[self stopActivityIndicator];
}];
// Start animation in case of download during attachment preparing