Commit 59f9c18b authored by Ghislain MARY's avatar Ghislain MARY

Check registration state before sending subscribe in the remote conference event handler.

parent 51915327
......@@ -169,8 +169,14 @@ void RemoteConferenceEventHandlerPrivate::simpleNotifyReceived (const string &xm
void RemoteConferenceEventHandlerPrivate::subscribe () {
if (lev || !subscriptionWanted)
return; // Already subscribed or application did not request subscription
const string &peerAddress = chatRoomId.getPeerAddress().asString();
LinphoneAddress *lAddr = linphone_address_new(peerAddress.c_str());
LinphoneCore *lc = conf->getCore()->getCCore();
LinphoneProxyConfig *cfg = linphone_core_lookup_known_proxy(lc, lAddr);
if (!cfg || (linphone_proxy_config_get_state(cfg) != LinphoneRegistrationOk))
return;
lev = linphone_core_create_subscribe(conf->getCore()->getCCore(), lAddr, "conference", 600);
lev->op->set_from(chatRoomId.getLocalAddress().asString().c_str());
const string &lastNotifyStr = Utils::toString(lastNotify);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment