fix testers

This commit is contained in:
Benjamin Reis 2018-05-07 17:17:39 +02:00
parent 60c83540c6
commit 670fee6809
3 changed files with 12 additions and 6 deletions

View file

@ -215,9 +215,13 @@ void ClientGroupChatRoomPrivate::onChatRoomCreated (const Address &remoteContact
IdentityAddress addr(remoteContact);
q->onConferenceCreated(addr);
if (remoteContact.hasParam("isfocus") && !q->getCore()->getPrivate()->remoteListEventHandler->findHandler(q->getChatRoomId())) {
bgTask.start(q->getCore(), 32); // It will be stopped when receiving the first notify
qConference->getPrivate()->eventHandler->subscribe(q->getChatRoomId());
if (remoteContact.hasParam("isfocus")) {
if (q->getCore()->getPrivate()->remoteListEventHandler->findHandler(q->getChatRoomId())) {
q->getCore()->getPrivate()->remoteListEventHandler->subscribe();
} else {
bgTask.start(q->getCore(), 32); // It will be stopped when receiving the first notify
qConference->getPrivate()->eventHandler->subscribe(q->getChatRoomId());
}
}
}

View file

@ -95,7 +95,6 @@ void LocalConferenceListEventHandler::subscribeReceived (LinphoneEvent *lev, con
Address addr(entry.getUri());
string notifyIdStr = addr.getUriParamValue("Last-Notify");
addr.removeUriParam("Last-Notify");
int notifyId = notifyIdStr.empty() ? 0 : Utils::stoi(notifyIdStr);
ChatRoomId chatRoomId(addr, addr);
LocalConferenceEventHandler *handler = findHandler(chatRoomId);
if (!handler)
@ -120,6 +119,7 @@ void LocalConferenceListEventHandler::subscribeReceived (LinphoneEvent *lev, con
}
device->setConferenceSubscribeEvent((subscriptionState == LinphoneSubscriptionIncomingReceived) ? lev : nullptr);
int notifyId = (notifyIdStr.empty() || device->getState() == ParticipantDevice::State::Joining) ? 0 : Utils::stoi(notifyIdStr);
string notifyBody = handler->getNotifyForId(notifyId, (chatRoom->getCapabilities() & AbstractChatRoom::Capabilities::OneToOne));
if (notifyBody.empty())
continue;

View file

@ -64,8 +64,10 @@ RemoteConferenceListEventHandler::~RemoteConferenceListEventHandler () {
// -----------------------------------------------------------------------------
void RemoteConferenceListEventHandler::subscribe () {
if (lev)
return;
if (lev) {
linphone_event_unref(lev);
lev = nullptr;
}
if (handlers.size() == 0)
return;