Skip to content

Commit a55cced

Browse files
Return CallStackCall
1 parent ad19168 commit a55cced

File tree

2 files changed

+15
-21
lines changed

2 files changed

+15
-21
lines changed

MatrixSDK/VoIP/CallStack/MXCallStackCall.h

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626

2727
NS_ASSUME_NONNULL_BEGIN
2828

29-
@class MXCall;
30-
3129
@protocol MXCallStackCallDelegate;
3230

3331
/**
@@ -64,7 +62,7 @@ NS_ASSUME_NONNULL_BEGIN
6462
/**
6563
Terminate the call.
6664
*/
67-
- (void)endCall:(MXCall*)call;
65+
- (void)end;
6866

6967
/**
7068
Add TURN or STUN servers.
@@ -97,8 +95,7 @@ NS_ASSUME_NONNULL_BEGIN
9795
@param success A block object called when the operation succeeds.
9896
@param failure A block object called when the operation fails.
9997
*/
100-
- (void)handleCall:(MXCall*)call
101-
offer:(NSString *)sdpOffer
98+
- (void)handleOffer:(NSString *)sdpOffer
10299
success:(void (^)(void))success
103100
failure:(void (^)(NSError *error))failure;
104101

@@ -114,8 +111,7 @@ NS_ASSUME_NONNULL_BEGIN
114111
of the answer.
115112
@param failure A block object called when the operation fails.
116113
*/
117-
- (void)createAnswer:(MXCall*)call
118-
success:(void (^)(NSString *sdpAnswer))success
114+
- (void)createAnswer:(void (^)(NSString *sdpAnswer))success
119115
failure:(void (^)(NSError *error))failure;
120116

121117
#pragma mark - Outgoing call
@@ -128,8 +124,7 @@ NS_ASSUME_NONNULL_BEGIN
128124
of the offer.
129125
@param failure A block object called when the operation fails.
130126
*/
131-
- (void)createCall:(MXCall*)call
132-
offer:(void (^)(NSString *sdp))success
127+
- (void)createOffer:(void (^)(NSString *sdp))success
133128
failure:(void (^)(NSError *error))failure;
134129

135130
/**
@@ -141,8 +136,7 @@ NS_ASSUME_NONNULL_BEGIN
141136
@param success A block object called when the operation succeeds.
142137
@param failure A block object called when the operation fails.
143138
*/
144-
- (void)handleAnswer:(MXCall*)call
145-
offer:(NSString *)sdp
139+
- (void)handleAnswer:(NSString *)sdp
146140
success:(void (^)(void))success
147141
failure:(void (^)(NSError *error))failure;
148142

MatrixSDK/VoIP/MXCall.m

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ - (void)callWithVideo:(BOOL)video
298298
#endif
299299

300300
MXWeakify(self);
301-
[self->callStackCall createCall: self offer:^(NSString *sdp) {
301+
[self->callStackCall createOffer:^(NSString *sdp) {
302302
MXStrongifyAndReturnIfNil(self);
303303

304304
[self setState:MXCallStateCreateOffer reason:nil];
@@ -388,7 +388,7 @@ - (void)answer
388388
[self setState:MXCallStateConnecting reason:nil];
389389

390390
MXWeakify(self);
391-
[self->callStackCall createAnswer: self success:^(NSString *sdpAnswer) {
391+
[self->callStackCall createAnswer:^(NSString *sdpAnswer) {
392392
MXStrongifyAndReturnIfNil(self);
393393

394394
MXLogDebug(@"[MXCall][%@] answer - Created SDP:\n%@", self.callId, sdpAnswer);
@@ -840,7 +840,7 @@ - (void)setState:(MXCallState)state reason:(MXEvent *)event
840840
incoming:self.isIncoming];
841841

842842
// Terminate the call at the stack level
843-
[callStackCall endCall: self];
843+
[callStackCall end];
844844
}
845845
else if (MXCallStateInviteSent == state)
846846
{
@@ -1158,7 +1158,7 @@ - (void)handleCallInvite:(MXEvent *)event
11581158
[self.audioOutputRouter reroute];
11591159
#endif
11601160

1161-
[self->callStackCall handleCall: self offer:self->callInviteEventContent.offer.sdp
1161+
[self->callStackCall handleAnswer:self->callInviteEventContent.offer.sdp
11621162
success:^{
11631163
MXStrongifyAndReturnIfNil(self);
11641164

@@ -1251,7 +1251,7 @@ - (void)handleCallAnswer:(MXEvent *)event
12511251
[self setState:MXCallStateConnecting reason:event];
12521252

12531253
MXWeakify(self);
1254-
[self->callStackCall handleAnswer:self offer:content.answer.sdp
1254+
[self->callStackCall handleAnswer:content.answer.sdp
12551255
success:^{}
12561256
failure:^(NSError *error) {
12571257
MXStrongifyAndReturnIfNil(self);
@@ -1449,14 +1449,14 @@ - (void)handleCallNegotiate:(MXEvent *)event
14491449
self.isVideoCall = content.isVideoCall;
14501450

14511451
MXWeakify(self);
1452-
[self->callStackCall handleCall: self offer:content.sessionDescription.sdp
1452+
[self->callStackCall handleOffer:content.sessionDescription.sdp
14531453
success:^{
14541454
MXStrongifyAndReturnIfNil(self);
14551455

14561456
// TODO: Get offer type from handleOffer and decide auto-accept it or not
14571457
// auto-accept negotiations for now
14581458
MXWeakify(self);
1459-
[self->callStackCall createAnswer:self success:^(NSString * _Nonnull sdpAnswer) {
1459+
[self->callStackCall createAnswer:^(NSString * _Nonnull sdpAnswer) {
14601460
MXStrongifyAndReturnIfNil(self);
14611461

14621462
MXLogDebug(@"[MXCall][%@] handleCallNegotiate: answer negotiation - Created SDP:\n%@", self.callId, sdpAnswer);
@@ -1497,7 +1497,7 @@ - (void)handleCallNegotiate:(MXEvent *)event
14971497
else if (content.sessionDescription.type == MXCallSessionDescriptionTypeAnswer)
14981498
{
14991499
MXWeakify(self);
1500-
[self->callStackCall handleAnswer:self offer:content.sessionDescription.sdp
1500+
[self->callStackCall handleAnswer:content.sessionDescription.sdp
15011501
success:^{}
15021502
failure:^(NSError *error) {
15031503
MXStrongifyAndReturnIfNil(self);
@@ -1631,7 +1631,7 @@ - (void)terminateWithReason:(MXEvent *)event
16311631
localIceGatheringTimer = nil;
16321632

16331633
// Terminate the call at the stack level
1634-
[callStackCall endCall:self];
1634+
[callStackCall end];
16351635

16361636
// Determine call end reason
16371637
if (event)
@@ -1731,7 +1731,7 @@ - (void)expireCallInvite
17311731
if (!_isIncoming)
17321732
{
17331733
// Terminate the call at the stack level we initiated
1734-
[callStackCall endCall: self];
1734+
[callStackCall end];
17351735
}
17361736

17371737
// If the call is not aleady ended

0 commit comments

Comments
 (0)