Skip to content

Commit a4860b0

Browse files
Add missing gk.call event handlers
1 parent 8f088ee commit a4860b0

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

MatrixSDK.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = "MatrixSDK"
4-
s.version = "0.26.4.6"
4+
s.version = "0.26.4.9"
55
s.summary = "The iOS SDK to build apps compatible with Matrix (https://www.matrix.org)"
66

77
s.description = <<-DESC

MatrixSDK/Contrib/Swift/JSONModels/MXEvent.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public enum MXEventType: Equatable, Hashable {
165165
}
166166

167167
public init(identifier: String) {
168-
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, .callAssertedIdentity, .callAssertedIdentityUnstable, .reaction, .receipt, .roomTombStone, .keyVerificationStart, .keyVerificationAccept, .keyVerificationKey, .keyVerificationMac, .keyVerificationCancel, .keyVerificationDone, .secretRequest, .secretSend, .secretStorageDefaultKey, .taggedEvents, .spaceChild, .spaceOrder, .pollStart, .pollResponse, .pollEnd, .beaconInfo, .beacon]
168+
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, .callInviteGk, .callCandidates, .callAnswer, .callAnswerGk, .callSelectAnswer, .callHangup, .callHangupGk, .callReject, .callRejectGk, .callNegotiate, .callReplaces, .callRejectReplacement, .callAssertedIdentity, .callAssertedIdentityUnstable, .reaction, .receipt, .roomTombStone, .keyVerificationStart, .keyVerificationAccept, .keyVerificationKey, .keyVerificationMac, .keyVerificationCancel, .keyVerificationDone, .secretRequest, .secretSend, .secretStorageDefaultKey, .taggedEvents, .spaceChild, .spaceOrder, .pollStart, .pollResponse, .pollEnd, .beaconInfo, .beacon]
169169

170170
if let type = events.first(where: { $0.identifier == identifier }) {
171171
self = type

MatrixSDK/VoIP/MXCall.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ - (void)hangupWithReason:(MXCallHangupReason)reason
509509
void(^terminateBlock)(void) = ^{
510510
// terminate with a fake reject event
511511
MXEvent *fakeEvent = [MXEvent modelFromJSON:@{
512-
@"type": kMXEventTypeStringCallReject,
512+
@"type": self->_isGkCall ? kMXEventTypeStringCallRejectGk : kMXEventTypeStringCallReject,
513513
@"content": content
514514
}];
515515
fakeEvent.sender = self->callManager.mxSession.myUserId;
@@ -555,7 +555,7 @@ - (void)hangupWithReason:(MXCallHangupReason)reason
555555
void(^terminateBlock)(void) = ^{
556556
// terminate with a fake hangup event
557557
MXEvent *fakeEvent = [MXEvent modelFromJSON:@{
558-
@"type": kMXEventTypeStringCallHangup,
558+
@"type": self->_isGkCall ? kMXEventTypeStringCallHangupGk : kMXEventTypeStringCallHangup,
559559
@"content": content
560560
}];
561561
fakeEvent.sender = self->callManager.mxSession.myUserId;
@@ -1653,6 +1653,7 @@ - (void)terminateWithReason:(MXEvent *)event
16531653
switch (event.eventType)
16541654
{
16551655
case MXEventTypeCallHangup:
1656+
case MXEventTypeCallHangupGk:
16561657
{
16571658
MXCallHangupEventContent *content = [MXCallHangupEventContent modelFromJSON:event.content];
16581659
MXCallHangupReason reason = content.reasonType;
@@ -1696,6 +1697,7 @@ - (void)terminateWithReason:(MXEvent *)event
16961697
break;
16971698
}
16981699
case MXEventTypeCallReject:
1700+
case MXEventTypeCallRejectGk:
16991701
{
17001702
_endReason = MXCallEndReasonBusy;
17011703
break;

0 commit comments

Comments
 (0)