summaryrefslogtreecommitdiff
path: root/indra/newview/llvoicechannel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvoicechannel.cpp')
-rw-r--r--indra/newview/llvoicechannel.cpp34
1 files changed, 31 insertions, 3 deletions
diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp
index b692093fb9..bd12328a6b 100644
--- a/indra/newview/llvoicechannel.cpp
+++ b/indra/newview/llvoicechannel.cpp
@@ -412,6 +412,7 @@ void LLVoiceChannel::doSetState(const EState& new_state)
{
EState old_state = mState;
mState = new_state;
+
if (!mStateChangedCallback.empty())
mStateChangedCallback(old_state, mState, mCallDirection, mCallEndedByAgent);
}
@@ -846,14 +847,19 @@ void LLVoiceChannelP2P::activate()
// otherwise answering the call
else
{
- LLVoiceClient::getInstance()->answerInvite(mSessionHandle);
-
+ if (!LLVoiceClient::getInstance()->answerInvite(mSessionHandle))
+ {
+ mCallEndedByAgent = false;
+ mSessionHandle.clear();
+ handleError(ERROR_UNKNOWN);
+ return;
+ }
// using the session handle invalidates it. Clear it out here so we can't reuse it by accident.
mSessionHandle.clear();
}
// Add the party to the list of people with which we've recently interacted.
- LLRecentPeople::instance().add(mOtherUserID);
+ addToTheRecentPeopleList();
//Default mic is ON on initiating/joining P2P calls
if (!LLVoiceClient::getInstance()->getUserPTTState() && LLVoiceClient::getInstance()->getPTTIsToggle())
@@ -938,3 +944,25 @@ void LLVoiceChannelP2P::setState(EState state)
LLVoiceChannel::setState(state);
}
+
+void LLVoiceChannelP2P::addToTheRecentPeopleList()
+{
+ bool avaline_call = LLIMModel::getInstance()->findIMSession(mSessionID)->isAvalineSessionType();
+
+ if (avaline_call)
+ {
+ LLSD call_data;
+ std::string call_number = LLVoiceChannel::getSessionName();
+
+ call_data["avaline_call"] = true;
+ call_data["session_id"] = mSessionID;
+ call_data["call_number"] = call_number;
+ call_data["date"] = LLDate::now();
+
+ LLRecentPeople::instance().add(mOtherUserID, call_data);
+ }
+ else
+ {
+ LLRecentPeople::instance().add(mOtherUserID);
+ }
+}