mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-29 07:42:40 +00:00
Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
6bd01d62fd
9 changed files with 80 additions and 74 deletions
12
CHANGES.rst
12
CHANGES.rst
|
@ -1,3 +1,15 @@
|
|||
Changes in 0.6.1 (2017-10-27)
|
||||
===============================================
|
||||
|
||||
Improvements:
|
||||
* Upgrade MatrixKit version (v0.7.1).
|
||||
* Add support for sending messages via Siri in e2e rooms, thanks to @morozkin (PR #1613).
|
||||
|
||||
Bug Fix:
|
||||
* Jitsi: Crash if the user display name has several components (#1616).
|
||||
* CallKit - When I reject or answer a call on one device, it should stop ringing on all other iOS devices (#1618).
|
||||
* The Call View Controller is displayed whereas the call has been cancelled.
|
||||
|
||||
Changes in 0.6.0 (2017-10-23)
|
||||
===============================================
|
||||
|
||||
|
|
4
Podfile
4
Podfile
|
@ -6,7 +6,7 @@ source 'https://github.com/CocoaPods/Specs.git'
|
|||
|
||||
# Different flavours of pods to MatrixKit
|
||||
# The current MatrixKit pod version
|
||||
$matrixKitVersion = '0.7.0'
|
||||
$matrixKitVersion = '0.7.1'
|
||||
|
||||
# The develop branch version
|
||||
#$matrixKitVersion = 'develop'
|
||||
|
@ -58,7 +58,7 @@ abstract_target 'RiotPods' do
|
|||
# OLMKit for crypto
|
||||
pod 'OLMKit'
|
||||
#pod 'OLMKit', :path => '../olm/OLMKit.podspec'
|
||||
pod 'Realm', '~> 3.0.0'
|
||||
pod 'Realm', '~> 3.0.1'
|
||||
|
||||
# Remove warnings from "bad" pods
|
||||
pod 'OLMKit', :inhibit_warnings => true
|
||||
|
|
36
Podfile.lock
36
Podfile.lock
|
@ -44,27 +44,27 @@ PODS:
|
|||
- GZIP (1.2.1)
|
||||
- HPGrowingTextView (1.1)
|
||||
- libPhoneNumber-iOS (0.9.12)
|
||||
- MatrixKit (0.7.0):
|
||||
- MatrixKit (0.7.1):
|
||||
- cmark (~> 0.24.1)
|
||||
- DTCoreText (~> 1.6.17)
|
||||
- HPGrowingTextView (~> 1.1)
|
||||
- libPhoneNumber-iOS (~> 0.9.10)
|
||||
- MatrixKit/Core (= 0.7.0)
|
||||
- MatrixSDK (= 0.10.0)
|
||||
- MatrixKit/AppExtension (0.7.0):
|
||||
- MatrixKit/Core (= 0.7.1)
|
||||
- MatrixSDK (= 0.10.1)
|
||||
- MatrixKit/AppExtension (0.7.1):
|
||||
- cmark (~> 0.24.1)
|
||||
- DTCoreText (~> 1.6.17)
|
||||
- DTCoreText/Extension
|
||||
- HPGrowingTextView (~> 1.1)
|
||||
- libPhoneNumber-iOS (~> 0.9.10)
|
||||
- MatrixSDK (= 0.10.0)
|
||||
- MatrixKit/Core (0.7.0):
|
||||
- MatrixSDK (= 0.10.1)
|
||||
- MatrixKit/Core (0.7.1):
|
||||
- cmark (~> 0.24.1)
|
||||
- DTCoreText (~> 1.6.17)
|
||||
- HPGrowingTextView (~> 1.1)
|
||||
- libPhoneNumber-iOS (~> 0.9.10)
|
||||
- MatrixSDK (= 0.10.0)
|
||||
- MatrixSDK (0.10.0):
|
||||
- MatrixSDK (= 0.10.1)
|
||||
- MatrixSDK (0.10.1):
|
||||
- AFNetworking (~> 3.1.0)
|
||||
- GZIP (~> 1.2.1)
|
||||
- OLMKit (2.2.2):
|
||||
|
@ -72,9 +72,9 @@ PODS:
|
|||
- OLMKit/olmcpp (= 2.2.2)
|
||||
- OLMKit/olmc (2.2.2)
|
||||
- OLMKit/olmcpp (2.2.2)
|
||||
- Realm (3.0.0):
|
||||
- Realm/Headers (= 3.0.0)
|
||||
- Realm/Headers (3.0.0)
|
||||
- Realm (3.0.1):
|
||||
- Realm/Headers (= 3.0.1)
|
||||
- Realm/Headers (3.0.1)
|
||||
- WebRTC (61.5.19063)
|
||||
|
||||
DEPENDENCIES:
|
||||
|
@ -82,10 +82,10 @@ DEPENDENCIES:
|
|||
- DTCoreText
|
||||
- GBDeviceInfo (~> 4.4.0)
|
||||
- GoogleAnalytics
|
||||
- MatrixKit (= 0.7.0)
|
||||
- MatrixKit/AppExtension (= 0.7.0)
|
||||
- MatrixKit (= 0.7.1)
|
||||
- MatrixKit/AppExtension (= 0.7.1)
|
||||
- OLMKit
|
||||
- Realm (~> 3.0.0)
|
||||
- Realm (~> 3.0.1)
|
||||
- WebRTC (= 61.5.19063)
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
|
@ -98,12 +98,12 @@ SPEC CHECKSUMS:
|
|||
GZIP: 7ee835f989fb3c6ea79005fc90b8fa6af710a70d
|
||||
HPGrowingTextView: 88a716d97fb853bcb08a4a08e4727da17efc9b19
|
||||
libPhoneNumber-iOS: b8a1038a101c78616c4df87815ac1556349faf98
|
||||
MatrixKit: 90b615acc35ff570a14264aa42aaf2136ae82bac
|
||||
MatrixSDK: 100443a3f7a34232b1a3c4f89ab2d51ddfabb02f
|
||||
MatrixKit: 32525c51dd8646a3338ebca7d528b0b04efd5483
|
||||
MatrixSDK: f6e05dd3061dd687f500d379483225b17c37e718
|
||||
OLMKit: b9d8c0ffee9ea8c45bc0aaa9afb47f93fba7efbd
|
||||
Realm: dec0de73be8c57506e39db72694d513c189493b3
|
||||
Realm: ba6144c74f835f7497791f6599d63a7755377b83
|
||||
WebRTC: 141474ba648e0b940a70696c183451b4a3b2b10f
|
||||
|
||||
PODFILE CHECKSUM: 7a5d279285ccaba22b78a9f4bae96554207c8753
|
||||
PODFILE CHECKSUM: fdb05558507dc165abd602ca91138a3ef11ad02d
|
||||
|
||||
COCOAPODS: 1.3.1
|
||||
|
|
|
@ -17,11 +17,11 @@
|
|||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.6.0</string>
|
||||
<string>0.6.1</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>0.6.0</string>
|
||||
<string>0.6.1</string>
|
||||
<key>ITSAppUsesNonExemptEncryption</key>
|
||||
<true/>
|
||||
<key>ITSEncryptionExportComplianceCode</key>
|
||||
|
|
|
@ -120,6 +120,7 @@
|
|||
|
||||
- (void)viewDidAppear:(BOOL)animated
|
||||
{
|
||||
NSLog(@"[MasterTabBarController] viewDidAppear");
|
||||
[super viewDidAppear:animated];
|
||||
|
||||
// Check whether we're not logged in
|
||||
|
@ -332,6 +333,8 @@
|
|||
|
||||
- (void)showAuthenticationScreen
|
||||
{
|
||||
NSLog(@"[MasterTabBarController] showAuthenticationScreen");
|
||||
|
||||
// Check whether an authentication screen is not already shown or preparing
|
||||
if (!self.authViewController && !isAuthViewControllerPreparing)
|
||||
{
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<key>CFBundlePackageType</key>
|
||||
<string>XPC!</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.6.0</string>
|
||||
<string>0.6.1</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>NSExtension</key>
|
||||
|
|
|
@ -146,7 +146,7 @@ typedef NS_ENUM(NSInteger, ImageCompressionMode)
|
|||
|
||||
__weak typeof(self) weakSelf = self;
|
||||
|
||||
[self.pendingImages removeAllObjects];
|
||||
[self resetPendingData];
|
||||
|
||||
for (NSExtensionItem *item in self.shareExtensionContext.inputItems)
|
||||
{
|
||||
|
@ -215,8 +215,7 @@ typedef NS_ENUM(NSInteger, ImageCompressionMode)
|
|||
|
||||
if ([self areAttachmentsFullyLoaded])
|
||||
{
|
||||
UIImage *firstImage = [UIImage imageWithData:self.pendingImages.firstObject];
|
||||
UIAlertController *compressionPrompt = [self compressionPromptForImage:firstImage shareBlock:^{
|
||||
UIAlertController *compressionPrompt = [self compressionPromptForImage:self.pendingImages.firstObject shareBlock:^{
|
||||
[self sendImages:self.pendingImages withProviders:item.attachments toRoom:room extensionItem:item failureBlock:failureBlock];
|
||||
}];
|
||||
|
||||
|
@ -293,22 +292,14 @@ typedef NS_ENUM(NSInteger, ImageCompressionMode)
|
|||
self.primaryViewController = nil;
|
||||
}
|
||||
|
||||
- (void)roomFromRoomSummary:(MXRoomSummary *)roomSummary store:(MXFileStore *)fileStore session:(MXSession *)session
|
||||
{
|
||||
[fileStore asyncAccountDataOfRoom:roomSummary.roomId success:^(MXRoomAccountData * _Nonnull accountData) {
|
||||
[fileStore asyncStateEventsOfRoom:roomSummary.roomId success:^(NSArray<MXEvent *> * _Nonnull roomStateEvents) {
|
||||
MXRoom *room = [[MXRoom alloc] initWithRoomId:roomSummary.roomId andMatrixSession:session andStateEvents:roomStateEvents andAccountData:accountData];
|
||||
} failure:^(NSError * _Nonnull error) {
|
||||
//sjh
|
||||
}];
|
||||
} failure:^(NSError * _Nonnull error) {
|
||||
//shj
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - Private
|
||||
|
||||
- (void)resetPendingData
|
||||
{
|
||||
[self.pendingImages removeAllObjects];
|
||||
[self.imageUploadProgresses removeAllObjects];
|
||||
}
|
||||
|
||||
- (void)completeRequestReturningItems:(nullable NSArray *)items completionHandler:(void(^ __nullable)(BOOL expired))completionHandler;
|
||||
{
|
||||
[self.shareExtensionContext completeRequestReturningItems:items completionHandler:completionHandler];
|
||||
|
@ -317,12 +308,13 @@ typedef NS_ENUM(NSInteger, ImageCompressionMode)
|
|||
self.primaryViewController = nil;
|
||||
}
|
||||
|
||||
- (UIAlertController *)compressionPromptForImage:(UIImage *)image shareBlock:(void(^)())shareBlock
|
||||
- (UIAlertController *)compressionPromptForImage:(NSData *)imageData shareBlock:(void(^)())shareBlock
|
||||
{
|
||||
UIAlertController *compressionPrompt;
|
||||
UIImage *image = [UIImage imageWithData:imageData];
|
||||
|
||||
// Get available sizes for this image
|
||||
MXKImageCompressionSizes compressionSizes = [MXKTools availableCompressionSizesForImage:image];
|
||||
MXKImageCompressionSizes compressionSizes = [MXKTools availableCompressionSizesForImage:image originalFileSize:imageData.length];
|
||||
|
||||
// Apply the compression mode
|
||||
if (compressionSizes.small.fileSize || compressionSizes.medium.fileSize || compressionSizes.large.fileSize)
|
||||
|
@ -579,13 +571,15 @@ typedef NS_ENUM(NSInteger, ImageCompressionMode)
|
|||
{
|
||||
[self didStartSendingToRoom:room];
|
||||
|
||||
__block NSUInteger count = imageDatas.count;
|
||||
|
||||
for (NSInteger index = 0; index < imageDatas.count; index++)
|
||||
{
|
||||
NSItemProvider *itemProvider = itemProviders[index];
|
||||
NSData *imageData = imageDatas[index];
|
||||
UIImage *image = [UIImage imageWithData:imageData];
|
||||
|
||||
if (!imageData)
|
||||
if (!image)
|
||||
{
|
||||
NSLog(@"[ShareExtensionManager] loadItemForTypeIdentifier: failed.");
|
||||
if (failureBlock)
|
||||
|
@ -597,43 +591,49 @@ typedef NS_ENUM(NSInteger, ImageCompressionMode)
|
|||
}
|
||||
|
||||
// Prepare the image
|
||||
NSData *convertedImageData;
|
||||
UIImage *convertedImage = image;
|
||||
|
||||
if (self.imageCompressionMode == ImageCompressionModeSmall)
|
||||
{
|
||||
image = [MXKTools reduceImage:image toFitInSize:CGSizeMake(MXKTOOLS_SMALL_IMAGE_SIZE, MXKTOOLS_SMALL_IMAGE_SIZE)];
|
||||
convertedImage = [MXKTools reduceImage:image toFitInSize:CGSizeMake(MXKTOOLS_SMALL_IMAGE_SIZE, MXKTOOLS_SMALL_IMAGE_SIZE)];
|
||||
}
|
||||
else if (self.imageCompressionMode == ImageCompressionModeMedium)
|
||||
{
|
||||
image = [MXKTools reduceImage:image toFitInSize:CGSizeMake(MXKTOOLS_MEDIUM_IMAGE_SIZE, MXKTOOLS_MEDIUM_IMAGE_SIZE)];
|
||||
convertedImage = [MXKTools reduceImage:image toFitInSize:CGSizeMake(MXKTOOLS_MEDIUM_IMAGE_SIZE, MXKTOOLS_MEDIUM_IMAGE_SIZE)];
|
||||
}
|
||||
else if (self.imageCompressionMode == ImageCompressionModeLarge)
|
||||
{
|
||||
image = [MXKTools reduceImage:image toFitInSize:CGSizeMake(self.actualLargeSize, self.actualLargeSize)];
|
||||
convertedImage = [MXKTools reduceImage:image toFitInSize:CGSizeMake(self.actualLargeSize, self.actualLargeSize)];
|
||||
}
|
||||
|
||||
// Make sure the uploaded image orientation is up
|
||||
image = [MXKTools forceImageOrientationUp:image];
|
||||
convertedImage = [MXKTools forceImageOrientationUp:convertedImage];
|
||||
|
||||
NSString *mimeType;
|
||||
if ([itemProvider hasItemConformingToTypeIdentifier:(__bridge NSString *)kUTTypePNG])
|
||||
{
|
||||
mimeType = @"image/png";
|
||||
convertedImageData = UIImagePNGRepresentation(image);
|
||||
if (convertedImage != image)
|
||||
{
|
||||
imageData = UIImagePNGRepresentation(convertedImage);
|
||||
}
|
||||
}
|
||||
else
|
||||
else if ([itemProvider hasItemConformingToTypeIdentifier:(__bridge NSString *)kUTTypeJPEG])
|
||||
{
|
||||
// Use jpeg format by default.
|
||||
mimeType = @"image/jpeg";
|
||||
convertedImageData = UIImageJPEGRepresentation(image, 0.9);
|
||||
if (convertedImage != image)
|
||||
{
|
||||
imageData = UIImageJPEGRepresentation(convertedImage, 0.9);
|
||||
}
|
||||
}
|
||||
|
||||
UIImage *thumbnail = nil;
|
||||
// Thumbnail is useful only in case of encrypted room
|
||||
if (room.state.isEncrypted)
|
||||
{
|
||||
thumbnail = [MXKTools reduceImage:image toFitInSize:CGSizeMake(800, 600)];
|
||||
if (thumbnail == image)
|
||||
thumbnail = [MXKTools reduceImage:convertedImage toFitInSize:CGSizeMake(800, 600)];
|
||||
if (thumbnail == convertedImage)
|
||||
{
|
||||
thumbnail = nil;
|
||||
}
|
||||
|
@ -641,33 +641,26 @@ typedef NS_ENUM(NSInteger, ImageCompressionMode)
|
|||
|
||||
__weak typeof(self) weakSelf = self;
|
||||
|
||||
[room sendImage:convertedImageData withImageSize:image.size mimeType:mimeType andThumbnail:thumbnail localEcho:nil success:^(NSString *eventId) {
|
||||
if (weakSelf)
|
||||
[room sendImage:imageData withImageSize:convertedImage.size mimeType:mimeType andThumbnail:thumbnail localEcho:nil success:^(NSString *eventId) {
|
||||
|
||||
if (!--count && weakSelf)
|
||||
{
|
||||
typeof(self) self = weakSelf;
|
||||
[imageDatas removeObject:imageData];
|
||||
|
||||
if (!imageDatas.count)
|
||||
{
|
||||
[self.shareExtensionContext completeRequestReturningItems:@[extensionItem] completionHandler:nil];
|
||||
}
|
||||
|
||||
[self resetPendingData];
|
||||
[self.shareExtensionContext completeRequestReturningItems:@[extensionItem] completionHandler:nil];
|
||||
}
|
||||
} failure:^(NSError *error) {
|
||||
NSLog(@"[ShareExtensionManager] sendImage failed.");
|
||||
[imageDatas removeObject:imageData];
|
||||
|
||||
if (!imageDatas.count)
|
||||
} failure:^(NSError *error) {
|
||||
|
||||
NSLog(@"[ShareExtensionManager] sendImage failed.");
|
||||
if (failureBlock)
|
||||
{
|
||||
if (failureBlock)
|
||||
{
|
||||
failureBlock(error);
|
||||
}
|
||||
failureBlock(error);
|
||||
}
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (void)sendVideo:(NSURL *)videoLocalUrl toRoom:(MXRoom *)room extensionItem:(NSExtensionItem *)extensionItem failureBlock:(void(^)(NSError *error))failureBlock
|
||||
|
|
|
@ -105,9 +105,8 @@
|
|||
// Check conditions to display the fake search bar into the table header
|
||||
if (self.recentsSearchBar.isHidden && self.recentsTableView.tableHeaderView == nil)
|
||||
{
|
||||
// Add the search bar by hiding it by default.
|
||||
// Add the search bar by showing it by default.
|
||||
self.recentsTableView.tableHeaderView = _tableSearchBar;
|
||||
self.recentsTableView.contentOffset = CGPointMake(0, self.recentsTableView.contentOffset.y + _tableSearchBar.frame.size.height);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -279,7 +278,6 @@
|
|||
- (void)searchBarTextDidEndEditing:(UISearchBar *)searchBar
|
||||
{
|
||||
[self.recentsSearchBar setShowsCancelButton:NO animated:NO];
|
||||
[self.dataSource searchWithPatterns:nil];
|
||||
}
|
||||
|
||||
#pragma mark - UIScrollViewDelegate
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<key>CFBundlePackageType</key>
|
||||
<string>XPC!</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.6.0</string>
|
||||
<string>0.6.1</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>NSExtension</key>
|
||||
|
|
Loading…
Reference in a new issue