diff --git a/Config/BuildSettings.swift b/Config/BuildSettings.swift index 3e26922f3..887f9137c 100644 --- a/Config/BuildSettings.swift +++ b/Config/BuildSettings.swift @@ -186,6 +186,7 @@ final class BuildSettings: NSObject { static let messageDetailsAllowShare: Bool = true static let messageDetailsAllowPermalink: Bool = true static let messageDetailsAllowViewSource: Bool = true + static let messageDetailsAllowSaving: Bool = true // MARK: - Authentication Screen diff --git a/Riot/Modules/Room/RoomViewController.m b/Riot/Modules/Room/RoomViewController.m index d65b87561..878fc332f 100644 --- a/Riot/Modules/Room/RoomViewController.m +++ b/Riot/Modules/Room/RoomViewController.m @@ -2609,40 +2609,43 @@ } else // Add action for attachment { - if (attachment.type == MXKAttachmentTypeImage || attachment.type == MXKAttachmentTypeVideo) + if (BuildSettings.messageDetailsAllowSaving) { - [currentAlert addAction:[UIAlertAction actionWithTitle:NSLocalizedStringFromTable(@"room_event_action_save", @"Vector", nil) - style:UIAlertActionStyleDefault - handler:^(UIAlertAction * action) { - - if (weakSelf) - { - typeof(self) self = weakSelf; - - [self cancelEventSelection]; - - [self startActivityIndicator]; - - [attachment save:^{ - - __strong __typeof(weakSelf)self = weakSelf; - [self stopActivityIndicator]; - - } failure:^(NSError *error) { - - __strong __typeof(weakSelf)self = weakSelf; - [self stopActivityIndicator]; - - //Alert user - [[AppDelegate theDelegate] showErrorAsAlert:error]; - - }]; - - // Start animation in case of download during attachment preparing - [roomBubbleTableViewCell startProgressUI]; - } - - }]]; + if (attachment.type == MXKAttachmentTypeImage || attachment.type == MXKAttachmentTypeVideo) + { + [currentAlert addAction:[UIAlertAction actionWithTitle:NSLocalizedStringFromTable(@"room_event_action_save", @"Vector", nil) + style:UIAlertActionStyleDefault + handler:^(UIAlertAction * action) { + + if (weakSelf) + { + typeof(self) self = weakSelf; + + [self cancelEventSelection]; + + [self startActivityIndicator]; + + [attachment save:^{ + + __strong __typeof(weakSelf)self = weakSelf; + [self stopActivityIndicator]; + + } failure:^(NSError *error) { + + __strong __typeof(weakSelf)self = weakSelf; + [self stopActivityIndicator]; + + //Alert user + [[AppDelegate theDelegate] showErrorAsAlert:error]; + + }]; + + // Start animation in case of download during attachment preparing + [roomBubbleTableViewCell startProgressUI]; + } + + }]]; + } } // Check status of the selected event