Skip to content

Commit

Permalink
Merge branch 'release/0.19.3/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
manuroe committed Jun 30, 2021
2 parents 81c1074 + 7303cf9 commit 09d5699
Show file tree
Hide file tree
Showing 38 changed files with 2,246 additions and 265 deletions.
33 changes: 33 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
Changes in 0.19.3 (2021-06-30)
=================================================

✨ Features
*

🙌 Improvements
* MXDehydrationService: Support full rehydration feature (vector-im/element-ios/issues/1117).
* MXSDKOptions: Add wellknownDomainUrl to customise the domain for wellknown (vector-im/element-ios/issues/#4489).
* MXSession: Refresh homeserverWellknown on every start.
* MXRoom: Added support for posting `m.image`s with BlurHash (MSC 2448).
* VoIP: Implement bridged version for call transfers.
* VoIP: Implement MXiOSAudioOutputRouter.

🐛 Bugfix
*

⚠️ API Changes
* MXCall: `audioToSpeaker` property removed. Use `audioOutputRouter` instead.
* MXCallStackCall: `audioToSpeaker` property removed. Audio routing should be handled high-level.

🗣 Translations
*

🧱 Build
*

Others
*

Improvements:


Changes in 0.19.2 (2021-06-24)
=================================================

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

s.name = "MatrixSDK"
s.version = "0.19.2"
s.version = "0.19.3"
s.summary = "The iOS SDK to build apps compatible with Matrix (https://www.matrix.org)"

s.description = <<-DESC
Expand Down Expand Up @@ -31,7 +31,7 @@ Pod::Spec.new do |s|
ss.osx.deployment_target = "10.10"

ss.source_files = "MatrixSDK", "MatrixSDK/**/*.{h,m}", "MatrixSDK/**/*.{swift}"

ss.osx.exclude_files = "MatrixSDK/VoIP/MXiOSAudioOutputRoute*.swift"

ss.dependency 'AFNetworking', '~> 4.0.0'
ss.dependency 'GZIP', '~> 1.3.0'
Expand Down
80 changes: 64 additions & 16 deletions MatrixSDK.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions MatrixSDK/Contrib/Swift/Data/MXRoom.swift
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ public extension MXRoom {
- size: the original size of the image.
- mimeType: the image mimetype.
- thumbnail: optional thumbnail image (may be nil).
- blurhash: optional BlurHash (may be nil).
- localEcho: a pointer to a MXEvent object.
This pointer is set to an actual MXEvent object
Expand All @@ -204,8 +205,8 @@ public extension MXRoom {
- returns: a `MXHTTPOperation` instance.
*/

@nonobjc @discardableResult func sendImage(data imageData: Data, size: CGSize, mimeType: String, thumbnail: MXImage?, localEcho: inout MXEvent?, completion: @escaping (_ response: MXResponse<String?>) -> Void) -> MXHTTPOperation {
return __sendImage(imageData, withImageSize: size, mimeType: mimeType, andThumbnail: thumbnail, localEcho: &localEcho, success: currySuccess(completion), failure: curryFailure(completion))
@nonobjc @discardableResult func sendImage(data imageData: Data, size: CGSize, mimeType: String, thumbnail: MXImage?, blurhash: String?, localEcho: inout MXEvent?, completion: @escaping (_ response: MXResponse<String?>) -> Void) -> MXHTTPOperation {
return __sendImage(imageData, withImageSize: size, mimeType: mimeType, andThumbnail: thumbnail, blurHash: blurhash, localEcho: &localEcho, success: currySuccess(completion), failure: curryFailure(completion))
}


Expand Down
15 changes: 0 additions & 15 deletions MatrixSDK/Contrib/Swift/MXRestClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1767,21 +1767,6 @@ public extension MXRestClient {
}


// MARK: - Dehydration

/**
Get the dehydrated device of the current account.
- parameters:
- response: Indicates whether the operation was successful or failed. In case of success, return the `MXDehydratedDevice` instance of the current account.
- returns: a `MXHTTPOperation` instance.
*/
@nonobjc @discardableResult func dehydratedDevice(completion: @escaping (_ response: MXResponse<MXDehydratedDevice>) -> Void) -> MXHTTPOperation {
return __dehydratedDevice(success: currySuccess(completion), failure: curryFailure(completion))
}


// MARK: - Direct-to-device messaging

/**
Expand Down
6 changes: 6 additions & 0 deletions MatrixSDK/Crypto/CrossSigning/MXCrossSigning_Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ NS_ASSUME_NONNULL_BEGIN

- (BOOL)isSecretValid:(NSString*)secret forPublicKeys:(NSString*)keys;

- (nullable NSString*)secretIdFromKeyType:(NSString*)keyType;

- (void)signDevice:(MXDeviceInfo*)device
success:(void (^)(void))success
failure:(void (^)(NSError *error))failure;

@end


Expand Down
39 changes: 39 additions & 0 deletions MatrixSDK/Crypto/Data/MXExportedOlmDevice.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//
// Copyright 2021 The Matrix.org Foundation C.I.C
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

/**
Data class that contains the pickled Olm account and the pickle key retrieved from the rehydration process.
*/
@interface MXExportedOlmDevice : NSObject

/// Olm account pickled with the pickle key
@property (nonatomic, nonnull) NSString *pickledAccount;
/// Key to be used to unpickle the account
@property (nonatomic, nonnull) NSData *pickleKey;
/// Sessions the Olm account belongs to
@property (nonatomic, nonnull) NSArray *sessions;

- (instancetype)initWithAccount:(NSString*)pickledAccount
pickleKey:(NSData*)pickleKey
forSessions:(NSArray*)sessions;

@end

NS_ASSUME_NONNULL_END
37 changes: 37 additions & 0 deletions MatrixSDK/Crypto/Data/MXExportedOlmDevice.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// Copyright 2021 The Matrix.org Foundation C.I.C
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#import "MXExportedOlmDevice.h"

@implementation MXExportedOlmDevice

- (instancetype)initWithAccount:(NSString*)pickledAccount
pickleKey:(NSData*)pickleKey
forSessions:(NSArray*)sessions
{
self = [super init];

if (self)
{
self.pickledAccount = pickledAccount;
self.pickleKey = pickleKey;
self.sessions = sessions;
}

return self;
}

@end
79 changes: 79 additions & 0 deletions MatrixSDK/Crypto/Dehydration/MXDehydrationService.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
//
// Copyright 2021 The Matrix.org Foundation C.I.C
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

@import Foundation;

@class MXCrypto;
@class MXRestClient;
@class MXExportedOlmDevice;

NS_ASSUME_NONNULL_BEGIN

/// ID of the algorithm used for the dehydration
FOUNDATION_EXPORT NSString *const MXDehydrationAlgorithm;

/// MXKeyProvider identifier for a 32 bytes long key used to pickle / unpickle the account of the dehydrated device.
FOUNDATION_EXPORT NSString *const MXDehydrationServiceKeyDataType;

/// Error domain for this class.
FOUNDATION_EXPORT NSString *const MXDehydrationServiceErrorDomain;
typedef NS_ENUM(NSInteger, MXDehydrationServiceErrorCode)
{
MXDehydrationServiceAlreadyRuninngErrorCode,
MXDehydrationServiceNothingToRehydrateErrorCode,
MXDehydrationServiceAlreadyClaimedErrorCode,
};

/**
Service in charge of dehydrating and rehydrating a device.
@see https://github.com/uhoreg/matrix-doc/blob/dehydration/proposals/2697-device-dehydration.md for more details
*/
@interface MXDehydrationService : NSObject

@property (nonatomic, readonly) BOOL inProgress;

/**
Dehydrate a new device for the current account
@param restClient client used to call the dehydration API
@param crypto crypto used to self sign the dehydrated device
@param dehydrationKey key used to pickle the Olm account
@param success callback called in case of success
@param failure callback called in case of unexpected failure
*/
- (void)dehydrateDeviceWithMatrixRestClient:(MXRestClient*)restClient
crypto:(MXCrypto*)crypto
dehydrationKey:(NSData*)dehydrationKey
success:(void (^)(NSString * deviceId))success
failure:(void (^)(NSError *error))failure;

/**
Rehydrate the dehydrated device of the current acount
@param restClient client used to call the dehydration API
@param dehydrationKey key used to unpickle the Olm account
@param success callback called in case of success
@param failure callback called in case of unexpected failure
*/
- (void)rehydrateDeviceWithMatrixRestClient:(MXRestClient*)restClient
dehydrationKey:(NSData*)dehydrationKey
success:(void (^)(NSString * deviceId))success
failure:(void (^)(NSError *error))failure;

@end

NS_ASSUME_NONNULL_END
Loading

0 comments on commit 09d5699

Please sign in to comment.