Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Only query "getPeersInCall" when using internal signaling #1951

Merged
merged 1 commit into from
Jan 24, 2025

Conversation

SystemKeeper
Copy link
Collaborator

Currently we query "getPeersInCall" whenever we join a call and whenever new sessions are processed. Both take not into account, that we need that information soley when using internal signaling:

- (TalkActor * _Nullable)getActorFromSessionId:(NSString *)sessionId
{
[[WebRTCCommon shared] assertQueue];
if (_externalSignalingController) {
return [_externalSignalingController getParticipantFromSessionId:sessionId].actor;
}
NSInteger callAPIVersion = [[NCAPIController sharedInstance] callAPIVersionForAccount:_account];
for (NSMutableDictionary *user in _peersInCall) {
NSString *userSessionId = [user objectForKey:@"sessionId"];
if ([userSessionId isEqualToString:sessionId]) {
TalkActor *actor = [[TalkActor alloc] initWithActorId:[user objectForKey:@"userId"] actorType:@"users" actorDisplayName:[user objectForKey:@"displayName"]];
if (callAPIVersion >= APIv3) {
[actor setId:[user objectForKey:@"actorId"]];
[actor setType:[user objectForKey:@"actorType"]];
}
return actor;
}
}
return nil;
}

Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
@SystemKeeper SystemKeeper requested a review from Ivansss January 21, 2025 19:01
@Ivansss Ivansss merged commit 0a2995c into master Jan 24, 2025
11 checks passed
@Ivansss Ivansss deleted the fix/noid/unneccessary-getpeersincall-api-calls branch January 24, 2025 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants