Skip to content

Commit

Permalink
Merge branch 'release/0.18.0/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ismailgulek committed Feb 11, 2021
2 parents a7b2f40 + b64499a commit 8af478c
Show file tree
Hide file tree
Showing 69 changed files with 4,609 additions and 722 deletions.
33 changes: 33 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
Changes in 0.18.0 (2021-02-11)
=================================================

✨ Features
*

🙌 Improvements
* Pods: Update JitsiMeetSDK to 3.1.0.
* Send VoIP analytics events (vector-im/element-ios/issues/3855).
* Add hold support for CallKit calls (vector-im/element-ios/issues/3834).
* Fix video call with web (vector-im/element-ios/issues/3862).
* VoIP: Call transfers initiation (vector-im/element-ios/issues/3872).
* VoIP: DTMF support in calls (vector-im/element-ios/issues/3929).

🐛 Bugfix
* MXRoomSummary: directUserId may be missing (null) for a direct chat if it was joined on another device.

⚠️ API Changes
*

🗣 Translations
*

🧱 Build
*

Others
*

Improvements:


Changes in 0.17.11 (2021-02-03)
=================================================

Expand All @@ -17,6 +49,7 @@ Changes in 0.17.11 (2021-02-03)
* Background Sync: Use autoreleasepool to limit RAM usage (vector-im/element-ios/issues/3957).
* Background Sync: Do not compact Realm DB from background process.
* MX3PidAddManager: Use a non empty client_secret to discover /account/3pid/add flows (vector-im/element-ios/issues/3966).
* VoIP: Fix camera indicator when video call answered elsewhere (vector-im/element-ios/issues/3971).

⚠️ API Changes
*
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.17.11"
s.version = "0.18.0"
s.summary = "The iOS SDK to build apps compatible with Matrix (https://www.matrix.org)"

s.description = <<-DESC
Expand Down Expand Up @@ -55,7 +55,7 @@ Pod::Spec.new do |s|
#ss.ios.dependency 'GoogleWebRTC', '~>1.1.21820'

# Use WebRTC framework included in Jitsi Meet SDK
ss.ios.dependency 'JitsiMeetSDK', ' 2.11.0'
ss.ios.dependency 'JitsiMeetSDK', ' 3.1.0'

# JitsiMeetSDK has not yet binaries for arm64 simulator
ss.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
Expand Down
269 changes: 266 additions & 3 deletions MatrixSDK.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion MatrixSDK/Contrib/Swift/JSONModels/MXEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ public enum MXEventType: Equatable, Hashable {
case callInvite
case callCandidates
case callAnswer
case callSelectAnswer
case callHangup
case callReject
case callNegotiate
case callReplaces
case callRejectReplacement
case reaction
case receipt
case roomTombStone
Expand Down Expand Up @@ -95,7 +100,12 @@ public enum MXEventType: Equatable, Hashable {
case .callInvite: return kMXEventTypeStringCallInvite
case .callCandidates: return kMXEventTypeStringCallCandidates
case .callAnswer: return kMXEventTypeStringCallAnswer
case .callSelectAnswer: return kMXEventTypeStringCallSelectAnswer
case .callHangup: return kMXEventTypeStringCallHangup
case .callReject: return kMXEventTypeStringCallReject
case .callNegotiate: return kMXEventTypeStringCallNegotiate
case .callReplaces: return kMXEventTypeStringCallReplaces
case .callRejectReplacement: return kMXEventTypeStringCallRejectReplacement
case .reaction: return kMXEventTypeStringReaction
case .receipt: return kMXEventTypeStringReceipt
case .roomTombStone: return kMXEventTypeStringRoomTombStone
Expand All @@ -116,7 +126,7 @@ public enum MXEventType: Equatable, Hashable {
}

public init(identifier: String) {
let events: [MXEventType] = [.roomName, .roomTopic, .roomAvatar, .roomMember, .roomCreate, .roomJoinRules, .roomPowerLevels, .roomAliases, .roomCanonicalAlias, .roomEncrypted, .roomEncryption, .roomGuestAccess, .roomHistoryVisibility, .roomKey, .roomForwardedKey, .roomKeyRequest, .roomMessage, .roomMessageFeedback, .roomRedaction, .roomThirdPartyInvite, .roomTag, .presence, .typing, .callInvite, .callCandidates, .callAnswer, .callHangup, .receipt, .roomTombStone, .taggedEvents]
let events: [MXEventType] = [.roomName, .roomTopic, .roomAvatar, .roomMember, .roomCreate, .roomJoinRules, .roomPowerLevels, .roomAliases, .roomCanonicalAlias, .roomEncrypted, .roomEncryption, .roomGuestAccess, .roomHistoryVisibility, .roomKey, .roomForwardedKey, .roomKeyRequest, .roomMessage, .roomMessageFeedback, .roomRedaction, .roomThirdPartyInvite, .roomTag, .presence, .typing, .callInvite, .callCandidates, .callAnswer, .callSelectAnswer, .callHangup, .callReject, .callNegotiate, .callReplaces, .callRejectReplacement, .receipt, .roomTombStone, .taggedEvents]
self = events.first(where: { $0.identifier == identifier }) ?? .custom(identifier)
}
}
Expand Down
60 changes: 60 additions & 0 deletions MatrixSDK/Contrib/Swift/JSONModels/MXJSONModels.swift
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,63 @@ public enum MXPushRuleScope: Equatable, Hashable {
self = scopes.first(where: { $0.identifier == identifier }) ?? .device(profileTag: identifier)
}
}

/// Hangup reason definitions
public enum MXCallHangupReason: Equatable, Hashable {
case userHangup
case iceFailed
case inviteTimeout
case iceTimeout
case userMediaFailed
case unknownError

public var identifier: String {
switch self {
case .userHangup:
return kMXCallHangupReasonStringUserHangup
case .iceFailed:
return kMXCallHangupReasonStringIceFailed
case .inviteTimeout:
return kMXCallHangupReasonStringInviteTimeout
case .iceTimeout:
return kMXCallHangupReasonStringIceTimeout
case .userMediaFailed:
return kMXCallHangupReasonStringUserMediaFailed
case .unknownError:
return kMXCallHangupReasonStringUnknownError
}
}

public init(identifier: String) {
let reasons: [MXCallHangupReason] = [.userHangup, .iceFailed, .inviteTimeout, .iceTimeout, .userMediaFailed, .unknownError]
self = reasons.first(where: { $0.identifier == identifier }) ?? .userHangup
}

}

/// Call reject replacement reason
public enum MXCallRejectReplacementReason: Equatable, Hashable {
case declined
case failedRoomInvite
case failedCallInvite
case failedCall

public var identifier: String {
switch self {
case .declined:
return kMXCallRejectReplacementReasonStringDeclined
case .failedRoomInvite:
return kMXCallRejectReplacementReasonStringFailedRoomInvite
case .failedCallInvite:
return kMXCallRejectReplacementReasonStringFailedCallInvite
case .failedCall:
return kMXCallRejectReplacementReasonStringFailedCall
}
}

public init(identifier: String) {
let reasons: [MXCallRejectReplacementReason] = [.declined, .failedRoomInvite, .failedCallInvite, .failedCall]
self = reasons.first(where: { $0.identifier == identifier }) ?? .declined
}

}
42 changes: 42 additions & 0 deletions MatrixSDK/JSONModels/Call/Events/MXCallAnswerEventContent.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//
// Copyright 2020 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>
#import "MXCallEventContent.h"

NS_ASSUME_NONNULL_BEGIN

@class MXCallSessionDescription;
@class MXCallCapabilitiesModel;

/**
`MXCallAnswerEventContent` represents the content of an `m.call.answer` event.
*/
@interface MXCallAnswerEventContent : MXCallEventContent

/**
The session description.
*/
@property (nonatomic) MXCallSessionDescription *answer;

/**
Capabilities for this call.
*/
@property (nonatomic, nullable) MXCallCapabilitiesModel *capabilities;

@end

NS_ASSUME_NONNULL_END
36 changes: 36 additions & 0 deletions MatrixSDK/JSONModels/Call/Events/MXCallAnswerEventContent.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// Copyright 2020 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 "MXCallAnswerEventContent.h"
#import "MXCallSessionDescription.h"
#import "MXCallCapabilitiesModel.h"

@implementation MXCallAnswerEventContent

+ (id)modelFromJSON:(NSDictionary *)JSONDictionary
{
MXCallAnswerEventContent *callAnswerEventContent = [[MXCallAnswerEventContent alloc] init];
if (callAnswerEventContent)
{
[callAnswerEventContent parseJSON:JSONDictionary];
MXJSONModelSetMXJSONModel(callAnswerEventContent.answer, MXCallSessionDescription, JSONDictionary[@"answer"]);
MXJSONModelSetMXJSONModel(callAnswerEventContent.capabilities, MXCallCapabilitiesModel, JSONDictionary[@"capabilities"]);
}

return callAnswerEventContent;
}

@end
35 changes: 35 additions & 0 deletions MatrixSDK/JSONModels/Call/Events/MXCallCandidatesEventContent.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//
// Copyright 2020 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>
#import "MXCallEventContent.h"
#import "MXCallCandidate.h"

NS_ASSUME_NONNULL_BEGIN

/**
`MXCallCandidatesEventContent` represents the content of an `m.call.candidates` event.
*/
@interface MXCallCandidatesEventContent : MXCallEventContent

/**
Array of object describing the candidates (@see MXCallCandidate).
*/
@property (nonatomic) NSArray<MXCallCandidate *> *candidates;

@end

NS_ASSUME_NONNULL_END
33 changes: 33 additions & 0 deletions MatrixSDK/JSONModels/Call/Events/MXCallCandidatesEventContent.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// Copyright 2020 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 "MXCallCandidatesEventContent.h"

@implementation MXCallCandidatesEventContent

+ (id)modelFromJSON:(NSDictionary *)JSONDictionary
{
MXCallCandidatesEventContent *callCandidatesEventContent = [[MXCallCandidatesEventContent alloc] init];
if (callCandidatesEventContent)
{
[callCandidatesEventContent parseJSON:JSONDictionary];
MXJSONModelSetMXJSONModelArray(callCandidatesEventContent.candidates, MXCallCandidate, JSONDictionary[@"candidates"]);
}

return callCandidatesEventContent;
}

@end
33 changes: 33 additions & 0 deletions MatrixSDK/JSONModels/Call/Events/MXCallCapabilitiesModel.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// Copyright 2020 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 <MatrixSDK/MatrixSDK.h>

NS_ASSUME_NONNULL_BEGIN

/**
`MXCallCapabilitiesModel` represents capabilities in `m.call.invite` and `m.call.answer` events.
*/
@interface MXCallCapabilitiesModel : MXJSONModel

/**
Capability defined by `m.call.transferee`.
*/
@property (nonatomic) BOOL transferee;

@end

NS_ASSUME_NONNULL_END
33 changes: 33 additions & 0 deletions MatrixSDK/JSONModels/Call/Events/MXCallCapabilitiesModel.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// Copyright 2020 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 "MXCallCapabilitiesModel.h"

@implementation MXCallCapabilitiesModel

+ (id)modelFromJSON:(NSDictionary *)JSONDictionary
{
MXCallCapabilitiesModel *capabilitiesModel = [[MXCallCapabilitiesModel alloc] init];

if (capabilitiesModel)
{
MXJSONModelSetBoolean(capabilitiesModel.transferee, JSONDictionary[@"m.call.transferee"]);
}

return capabilitiesModel;
}

@end
Loading

0 comments on commit 8af478c

Please sign in to comment.