mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-29 15:52:40 +00:00
Merge pull request #3750 from vector-im/configurable_media_copy_paste
Make Media Copy/Paste Configurable
This commit is contained in:
commit
134917b929
4 changed files with 10 additions and 0 deletions
|
@ -7,6 +7,7 @@ Changes to be released in next version
|
|||
🙌 Improvements
|
||||
* Device verification: Do not check for existing key backup after SSSS & Cross-Signing reset.
|
||||
* Cross-signing: Detect when cross-signing keys have been changed.
|
||||
* Make copying & pasting media configurable.
|
||||
|
||||
🐛 Bugfix
|
||||
*
|
||||
|
|
|
@ -216,6 +216,8 @@ final class BuildSettings: NSObject {
|
|||
static let messageDetailsAllowPermalink: Bool = true
|
||||
static let messageDetailsAllowViewSource: Bool = true
|
||||
static let messageDetailsAllowSave: Bool = true
|
||||
static let messageDetailsAllowCopyMedia: Bool = true
|
||||
static let messageDetailsAllowPasteMedia: Bool = true
|
||||
|
||||
// MARK: - HTTP
|
||||
/// Additional HTTP headers will be sent by all requests. Not recommended to use request-specific headers, like `Authorization`.
|
||||
|
|
|
@ -43,6 +43,8 @@ class CommonConfiguration: NSObject, Configurable {
|
|||
|
||||
settings.messageDetailsAllowSharing = BuildSettings.messageDetailsAllowShare
|
||||
settings.messageDetailsAllowSaving = BuildSettings.messageDetailsAllowSave
|
||||
settings.messageDetailsAllowCopyingMedia = BuildSettings.messageDetailsAllowCopyMedia
|
||||
settings.messageDetailsAllowPastingMedia = BuildSettings.messageDetailsAllowPasteMedia
|
||||
|
||||
MXKContactManager.shared().allowLocalContactsAccess = BuildSettings.allowLocalContactsAccess
|
||||
}
|
||||
|
|
|
@ -5209,6 +5209,11 @@
|
|||
|
||||
BOOL isCopyActionEnabled = !attachment || attachment.type != MXKAttachmentTypeSticker;
|
||||
|
||||
if (attachment && !BuildSettings.messageDetailsAllowCopyMedia)
|
||||
{
|
||||
isCopyActionEnabled = NO;
|
||||
}
|
||||
|
||||
if (isCopyActionEnabled)
|
||||
{
|
||||
switch (event.eventType) {
|
||||
|
|
Loading…
Reference in a new issue