Skip to content

Commit f15e81e

Browse files
Add type to the invite content
1 parent 7bf4ae5 commit f15e81e

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

MatrixSDK/JSONModels/Call/Events/MXCallInviteEventContent.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ NS_ASSUME_NONNULL_BEGIN
4949
*/
5050
@property (nonatomic) MXCallCapabilitiesModel *capabilities;
5151

52+
/**
53+
Type of this call.
54+
*/
55+
@property (nonatomic, copy, nullable) NSString *type;
56+
5257
/**
5358
Indicate whether the invitation is for a video call.
5459
*/

MatrixSDK/JSONModels/Call/Events/MXCallInviteEventContent.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,23 @@ + (id)modelFromJSON:(NSDictionary *)JSONDictionary
3030
MXJSONModelSetUInteger(callInviteEventContent.lifetime, JSONDictionary[@"lifetime"]);
3131
MXJSONModelSetString(callInviteEventContent.invitee, JSONDictionary[@"invitee"]);
3232
MXJSONModelSetMXJSONModel(callInviteEventContent.capabilities, MXCallCapabilitiesModel, JSONDictionary[@"capabilities"]);
33+
34+
if (JSONDictionary[@"type"]) {
35+
MXJSONModelSetString(callInviteEventContent.type, JSONDictionary[@"type"]);
36+
}
37+
3338
}
3439

3540
return callInviteEventContent;
3641
}
3742

3843
- (BOOL)isVideoCall
3944
{
45+
if (_type) {
46+
return [_type isEqual:@"video"];
47+
} else {
4048
return (NSNotFound != [self.offer.sdp rangeOfString:@"m=video"].location);
49+
}
4150
}
4251

4352
@end

MatrixSDK/VoIP/MXCall.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,8 @@ - (void)callWithVideo:(BOOL)video
315315
@"version": kMXCallVersion,
316316
@"lifetime": @(self->callManager.inviteLifetime),
317317
@"capabilities": @{@"m.call.transferee": @(NO)},
318-
@"party_id": self.partyId
318+
@"party_id": self.partyId,
319+
@"type": video ? @"video" : @"voice"
319320
} mutableCopy];
320321

321322
NSString *directUserId = self.room.directUserId;

0 commit comments

Comments
 (0)