Skip to content
This repository has been archived by the owner on Dec 12, 2022. It is now read-only.

Commit

Permalink
Merge branch 'release/0.12.25/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
manuroe committed Oct 14, 2020
2 parents e0ab16d + 1c4ca08 commit 7c89643
Show file tree
Hide file tree
Showing 9 changed files with 94 additions and 48 deletions.
27 changes: 27 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
Changes in 0.12.25 (2020-10-14)
=================================================

✨ Features
*

🙌 Improvements
* Make copying & pasting media configurable.

🐛 Bugfix
*

⚠️ API Changes
*

🗣 Translations
*

🧱 Build
*

Others
*

Improvements:
* Upgrade MatrixSDK version ([v0.16.19](https://github.com/matrix-org/matrix-ios-sdk/releases/tag/v0.16.19)).

Changes in 0.12.24 (2020-10-13)
=================================================

Expand Down
4 changes: 2 additions & 2 deletions MatrixKit.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "MatrixKit"
s.version = "0.12.24"
s.version = "0.12.25"
s.summary = "The Matrix reusable UI library for iOS based on MatrixSDK."

s.description = <<-DESC
Expand All @@ -23,7 +23,7 @@ Pod::Spec.new do |s|

s.swift_version = '5.0'

s.dependency 'MatrixSDK', "0.16.18"
s.dependency 'MatrixSDK', "= 0.16.19"
s.dependency 'HPGrowingTextView', '~> 1.1'
s.dependency 'libPhoneNumber-iOS', '~> 0.9.13'
s.dependency 'DTCoreText', '~> 1.6.23'
Expand Down
84 changes: 47 additions & 37 deletions MatrixKit/Controllers/MXKAttachmentsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1219,31 +1219,34 @@ - (void)onCollectionViewCellLongPress:(UIGestureRecognizer*)gestureRecognizer
}]];
}

[currentAlert addAction:[UIAlertAction actionWithTitle:[NSBundle mxk_localizedStringForKey:@"copy"]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {

typeof(self) self = weakSelf;
self->currentAlert = nil;

[self startActivityIndicator];

[attachment copy:^{

typeof(self) self = weakSelf;
[self stopActivityIndicator];

} failure:^(NSError *error) {

typeof(self) self = weakSelf;
[self stopActivityIndicator];

// Notify MatrixKit user
[[NSNotificationCenter defaultCenter] postNotificationName:kMXKErrorNotification object:error];

}];

}]];
if ([MXKAppSettings standardAppSettings].messageDetailsAllowCopyingMedia)
{
[currentAlert addAction:[UIAlertAction actionWithTitle:[NSBundle mxk_localizedStringForKey:@"copy"]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {

typeof(self) self = weakSelf;
self->currentAlert = nil;

[self startActivityIndicator];

[attachment copy:^{

typeof(self) self = weakSelf;
[self stopActivityIndicator];

} failure:^(NSError *error) {

typeof(self) self = weakSelf;
[self stopActivityIndicator];

// Notify MatrixKit user
[[NSNotificationCenter defaultCenter] postNotificationName:kMXKErrorNotification object:error];

}];

}]];
}

if ([MXKAppSettings standardAppSettings].messageDetailsAllowSharing)
{
Expand Down Expand Up @@ -1307,18 +1310,25 @@ - (void)onCollectionViewCellLongPress:(UIGestureRecognizer*)gestureRecognizer
}]];
}

[currentAlert addAction:[UIAlertAction actionWithTitle:[NSBundle mxk_localizedStringForKey:@"cancel"]
style:UIAlertActionStyleCancel
handler:^(UIAlertAction * action) {

typeof(self) self = weakSelf;
self->currentAlert = nil;

}]];

[currentAlert popoverPresentationController].sourceView = _attachmentsCollection;
[currentAlert popoverPresentationController].sourceRect = _attachmentsCollection.bounds;
[self presentViewController:currentAlert animated:YES completion:nil];
if (currentAlert.actions.count)
{
[currentAlert addAction:[UIAlertAction actionWithTitle:[NSBundle mxk_localizedStringForKey:@"cancel"]
style:UIAlertActionStyleCancel
handler:^(UIAlertAction * action) {

typeof(self) self = weakSelf;
self->currentAlert = nil;

}]];

[currentAlert popoverPresentationController].sourceView = _attachmentsCollection;
[currentAlert popoverPresentationController].sourceRect = _attachmentsCollection.bounds;
[self presentViewController:currentAlert animated:YES completion:nil];
}
else
{
currentAlert = nil;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion MatrixKit/MatrixKitVersion.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@

#import <Foundation/Foundation.h>

NSString *const MatrixKitVersion = @"0.12.24";
NSString *const MatrixKitVersion = @"0.12.25";
6 changes: 6 additions & 0 deletions MatrixKit/Models/MXKAppSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@
/// Flag to allow saving a message or not. Default value is YES.
@property (nonatomic) BOOL messageDetailsAllowSaving;

/// Flag to allow copying a media/file or not. Default value is YES.
@property (nonatomic) BOOL messageDetailsAllowCopyingMedia;

/// Flag to allow pasting a media/file or not. Default value is YES.
@property (nonatomic) BOOL messageDetailsAllowPastingMedia;

#pragma mark - Contacts

/**
Expand Down
2 changes: 2 additions & 0 deletions MatrixKit/Models/MXKAppSettings.m
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ -(instancetype)init

_messageDetailsAllowSharing = YES;
_messageDetailsAllowSaving = YES;
_messageDetailsAllowCopyingMedia = YES;
_messageDetailsAllowPastingMedia = YES;
}
return self;
}
Expand Down
3 changes: 2 additions & 1 deletion MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarView.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#import "MXKRoomInputToolbarView.h"
#import "MXKSwiftHeader.h"
#import "MXKAppSettings.h"

@import MatrixSDK.MXMediaManager;
@import MediaPlayer;
Expand Down Expand Up @@ -1331,7 +1332,7 @@ - (void)paste:(id)sender

- (BOOL)canPerformAction:(SEL)action withSender:(id)sender
{
if (action == @selector(paste:))
if (action == @selector(paste:) && MXKAppSettings.standardAppSettings.messageDetailsAllowPastingMedia)
{
// Check whether some data listed in general pasteboard can be paste
UIPasteboard *pasteboard = MXKPasteboardManager.shared.pasteboard;
Expand Down
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ abstract_target 'MatrixKitSamplePods' do

# Different flavours of pods to Matrix SDK
# The tagged version on which this version of MatrixKit has been built
pod 'MatrixSDK', '0.16.18'
pod 'MatrixSDK', '= 0.16.19'

# The lastest release available on the CocoaPods repository
#pod 'MatrixSDK'
Expand Down
12 changes: 6 additions & 6 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ PODS:
- JSQSystemSoundPlayer (2.0.1)
- libbase58 (0.1.4)
- libPhoneNumber-iOS (0.9.15)
- MatrixSDK (0.16.18):
- MatrixSDK/Core (= 0.16.18)
- MatrixSDK/Core (0.16.18):
- MatrixSDK (0.16.19):
- MatrixSDK/Core (= 0.16.19)
- MatrixSDK/Core (0.16.19):
- AFNetworking (~> 4.0.0)
- GZIP (~> 1.2.2)
- libbase58 (~> 0.1.4)
Expand All @@ -62,7 +62,7 @@ DEPENDENCIES:
- HPGrowingTextView (~> 1.1)
- JSQMessagesViewController (~> 7.2.0)
- libPhoneNumber-iOS (~> 0.9.13)
- MatrixSDK (= 0.16.18)
- MatrixSDK (= 0.16.19)

SPEC REPOS:
trunk:
Expand Down Expand Up @@ -91,10 +91,10 @@ SPEC CHECKSUMS:
JSQSystemSoundPlayer: c5850e77a4363ffd374cd851154b9af93264ed8d
libbase58: 7c040313537b8c44b6e2d15586af8e21f7354efd
libPhoneNumber-iOS: 0a32a9525cf8744fe02c5206eb30d571e38f7d75
MatrixSDK: 7bdaee197004919ae34670d5ba043d5bff95e4df
MatrixSDK: 1c4aee61037751f3b582ea09dbc7efeaf9b423d0
OLMKit: 4ee0159d63feeb86d836fdcfefe418e163511639
Realm: 4eb04d7487bd43c0581256f40b424eafb711deff

PODFILE CHECKSUM: e88ba23066d2bffbe17e53ff64f68811bcfc138b
PODFILE CHECKSUM: dae5c7956eca120b0421f0511d09bb286ae9228a

COCOAPODS: 1.9.3

0 comments on commit 7c89643

Please sign in to comment.