Skip to content
Snippets Groups Projects
Commit 70bf1356 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk
Browse files

conference: use uri to set active participant

Change-Id: I4762f94ae95ff8c5a44dfe09dbc2f9b90fd458c5
parent 30202a8e
No related branches found
No related tags found
No related merge requests found
......@@ -1328,31 +1328,24 @@ CVPixelBufferRef pixelBufferPreview;
-(void)maximizeParticipant:(NSString*)uri active:(BOOL)isActive {
if (accountInfo_ == nil)
return;
auto convIt = getConversationFromURI(QString::fromNSString(uri), *accountInfo_->conversationModel);
QString callId;
BOOL localVideo = accountInfo_->profileInfo.uri == QString::fromNSString(uri);
if (!localVideo) {
auto convIt = getConversationFromURI(QString::fromNSString(uri), *accountInfo_->conversationModel);
callId = convIt->callId;
}
auto* callModel = accountInfo_->callModel.get();
if ((not callModel->hasCall(callId) || not callModel->hasCall(confUid_)) && !localVideo){
if (not callModel->hasCall(confUid_) && !localVideo)
return;
}
try {
auto call = callModel->getCall(confUid_);
switch (call.layout) {
case lrc::api::call::Layout::GRID:
callModel->setActiveParticipant(confUid_, callId);
callModel->setActiveParticipant(confUid_, QString::fromNSString(uri));
callModel->setConferenceLayout(confUid_, lrc::api::call::Layout::ONE_WITH_SMALL);
break;
case lrc::api::call::Layout::ONE_WITH_SMALL:
callModel->setActiveParticipant(confUid_, callId);
callModel->setActiveParticipant(confUid_, QString::fromNSString(uri));
callModel->setConferenceLayout(confUid_,
isActive ? lrc::api::call::Layout::ONE : lrc::api::call::Layout::ONE_WITH_SMALL);
break;
case lrc::api::call::Layout::ONE:
callModel->setActiveParticipant(confUid_, callId);
callModel->setActiveParticipant(confUid_, QString::fromNSString(uri));
callModel->setConferenceLayout(confUid_, lrc::api::call::Layout::GRID);
break;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment