Commit ca25c5ad authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Merge branch 'feature/chat-logs-improvement' into 'master'

Improve chat logs, mainly by tracing the chat room states.

See merge request BC/public/linphone!5
parents 3131fc4d 6977d0e6
Pipeline #378 failed with stage
in 0 seconds
......@@ -234,6 +234,7 @@ void ChatRoomPrivate::notifyIsComposingReceived (const Address &remoteAddress, b
void ChatRoomPrivate::notifyStateChanged () {
L_Q();
LinphoneChatRoom *cr = getCChatRoom();
lInfo() << "Chat room [" << q->getChatRoomId() << "] state changed to: " << Utils::toString(state);
linphone_core_notify_chat_room_state_changed(q->getCore()->getCCore(), cr, (LinphoneChatRoomState)state);
_linphone_chat_room_notify_state_changed(cr, (LinphoneChatRoomState)state);
}
......
......@@ -587,7 +587,8 @@ void ClientGroupChatRoom::onFirstNotifyReceived (const IdentityAddress &addr) {
L_D();
if (getState() != ChatRoom::State::Created) {
lWarning() << "First notify received in ClientGroupChatRoom that is not in the Created state, ignoring it!";
lWarning() << "First notify received in ClientGroupChatRoom that is not in the Created state ["
<< Utils::toString(getState()) << "], ignoring it!";
return;
}
......
......@@ -406,7 +406,7 @@ void LocalConferenceEventHandler::subscribeReceived (LinphoneEvent *lev, bool on
shared_ptr<Participant> participant = d->conf->findParticipant(Address(addrStr));
bctbx_free(addrStr);
if (!participant) {
lError() << "received SUBSCRIBE corresponds to no participant of the conference; " << d->conf->getConferenceAddress().asString() << ", no NOTIFY sent.";
lError() << "Received SUBSCRIBE corresponds to no participant of the conference [" << d->conf->getConferenceAddress() << "], no NOTIFY sent";
linphone_event_deny_subscription(lev, LinphoneReasonDeclined);
return;
}
......@@ -417,8 +417,8 @@ void LocalConferenceEventHandler::subscribeReceived (LinphoneEvent *lev, bool on
bctbx_free(contactAddrStr);
shared_ptr<ParticipantDevice> device = participant->getPrivate()->findDevice(contactAddr);
if (!device || (device->getState() != ParticipantDevice::State::Present && device->getState() != ParticipantDevice::State::Joining)) {
lError() << "received SUBSCRIBE for conference: " << d->conf->getConferenceAddress().asString()
<< "device sending subscribe: " << contactAddr.asString() << " is not known, no NOTIFY sent.";
lError() << "Received SUBSCRIBE for conference [" << d->conf->getConferenceAddress()
<< "], device sending subscribe [" << contactAddr << "] is not known, no NOTIFY sent";
linphone_event_deny_subscription(lev, LinphoneReasonDeclined);
return;
}
......@@ -428,17 +428,16 @@ void LocalConferenceEventHandler::subscribeReceived (LinphoneEvent *lev, bool on
unsigned int lastNotify = static_cast<unsigned int>(Utils::stoi(linphone_event_get_custom_header(lev, "Last-Notify-Version")));
device->setConferenceSubscribeEvent(lev);
if (lastNotify == 0 || (device->getState() == ParticipantDevice::State::Joining)) {
lInfo() << "Sending initial notify of conference:" << d->conf->getConferenceAddress().asString() << " to: " << device->getAddress().asString();
lInfo() << "Sending initial notify of conference [" << d->conf->getConferenceAddress() << "] to: " << device->getAddress();
d->notifyFullState(d->createNotifyFullState(static_cast<int>(d->lastNotify), oneToOne), device);
} else if (lastNotify < d->lastNotify) {
lInfo() << "Sending all missed notify [" << lastNotify << "-" << d->lastNotify <<
"] for conference:" << d->conf->getConferenceAddress().asString() <<
" to: " << participant->getAddress().asString();
"] for conference [" << d->conf->getConferenceAddress() << "] to: " << participant->getAddress();
d->notifyParticipantDevice(d->createNotifyMultipart(static_cast<int>(lastNotify)), device, true);
} else if (lastNotify > d->lastNotify) {
lError() << "last notify received by client: [" << lastNotify <<"] for conference:" <<
d->conf->getConferenceAddress().asString() <<
" should not be higher than last notify sent by server: [" << d->lastNotify << "]";
lError() << "Last notify received by client [" << lastNotify << "] for conference [" <<
d->conf->getConferenceAddress() <<
"] should not be higher than last notify sent by server [" << d->lastNotify << "]";
}
} else if (linphone_event_get_subscription_state(lev) == LinphoneSubscriptionTerminated)
device->setConferenceSubscribeEvent(nullptr);
......
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