summaryrefslogtreecommitdiff
path: root/indra/newview/llimview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llimview.cpp')
-rw-r--r--indra/newview/llimview.cpp48
1 files changed, 37 insertions, 11 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 4780e985ca..4357c7d426 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -36,6 +36,7 @@
#include "llfloaterreg.h"
#include "llfontgl.h"
+#include "llgl.h"
#include "llrect.h"
#include "llerror.h"
#include "llbutton.h"
@@ -80,6 +81,9 @@ const static std::string ADHOC_NAME_SUFFIX(" Conference");
const static std::string NEARBY_P2P_BY_OTHER("nearby_P2P_by_other");
const static std::string NEARBY_P2P_BY_AGENT("nearby_P2P_by_agent");
+/** Timeout of outgoing session initialization (in seconds) */
+const static U32 SESSION_INITIALIZATION_TIMEOUT = 30;
+
std::string LLCallDialogManager::sPreviousSessionlName = "";
LLIMModel::LLIMSession::SType LLCallDialogManager::sPreviousSessionType = LLIMModel::LLIMSession::P2P_SESSION;
std::string LLCallDialogManager::sCurrentSessionlName = "";
@@ -91,6 +95,19 @@ const LLUUID LLOutgoingCallDialog::OCD_KEY = LLUUID("7CF78E11-0CFE-498D-ADB9-141
//
LLIMMgr* gIMMgr = NULL;
+
+BOOL LLSessionTimeoutTimer::tick()
+{
+ if (mSessionId.isNull()) return TRUE;
+
+ LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(mSessionId);
+ if (session && !session->mSessionInitialized)
+ {
+ gIMMgr->showSessionStartError("session_initialization_timed_out_error", mSessionId);
+ }
+ return TRUE;
+}
+
void toast_callback(const LLSD& msg){
// do not show toast in busy mode or it goes from agent
if (gAgent.getBusy() || gAgent.getID() == msg["from_id"])
@@ -146,7 +163,7 @@ LLIMModel::LLIMModel()
addNewMsgCallback(toast_callback);
}
-LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& name, const EInstantMessage& type, const LLUUID& other_participant_id, const std::vector<LLUUID>& ids, bool voice)
+LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& name, const EInstantMessage& type, const LLUUID& other_participant_id, const uuid_vec_t& ids, bool voice)
: mSessionID(session_id),
mName(name),
mType(type),
@@ -214,6 +231,11 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string&
//so we're already initialized
mSessionInitialized = true;
}
+ else
+ {
+ //tick returns TRUE - timer will be deleted after the tick
+ new LLSessionTimeoutTimer(mSessionID, SESSION_INITIALIZATION_TIMEOUT);
+ }
if (IM_NOTHING_SPECIAL == type)
{
@@ -275,7 +297,7 @@ void LLIMModel::LLIMSession::onVoiceChannelStateChanged(const LLVoiceChannel::ES
LLIMModel::getInstance()->addMessage(mSessionID, SYSTEM_FROM, LLUUID::null, message);
break;
case LLVoiceChannel::STATE_CONNECTED :
- message = other_avatar_name + " " + joined_call;
+ message = LLTrans::getString("answered_call");
LLIMModel::getInstance()->addMessage(mSessionID, SYSTEM_FROM, LLUUID::null, message);
default:
break;
@@ -423,7 +445,7 @@ LLIMModel::LLIMSession* LLIMModel::findIMSession(const LLUUID& session_id) const
}
//*TODO consider switching to using std::set instead of std::list for holding LLUUIDs across the whole code
-LLIMModel::LLIMSession* LLIMModel::findAdHocIMSession(const std::vector<LLUUID>& ids)
+LLIMModel::LLIMSession* LLIMModel::findAdHocIMSession(const uuid_vec_t& ids)
{
S32 num = ids.size();
if (!num) return NULL;
@@ -440,7 +462,7 @@ LLIMModel::LLIMSession* LLIMModel::findAdHocIMSession(const std::vector<LLUUID>&
std::list<LLUUID> tmp_list(session->mInitialTargetIDs.begin(), session->mInitialTargetIDs.end());
- std::vector<LLUUID>::const_iterator iter = ids.begin();
+ uuid_vec_t::const_iterator iter = ids.begin();
while (iter != ids.end())
{
tmp_list.remove(*iter);
@@ -571,7 +593,7 @@ void LLIMModel::testMessages()
//session name should not be empty
bool LLIMModel::newSession(const LLUUID& session_id, const std::string& name, const EInstantMessage& type,
- const LLUUID& other_participant_id, const std::vector<LLUUID>& ids, bool voice)
+ const LLUUID& other_participant_id, const uuid_vec_t& ids, bool voice)
{
if (name.empty())
{
@@ -596,7 +618,7 @@ bool LLIMModel::newSession(const LLUUID& session_id, const std::string& name, co
bool LLIMModel::newSession(const LLUUID& session_id, const std::string& name, const EInstantMessage& type, const LLUUID& other_participant_id, bool voice)
{
- std::vector<LLUUID> no_ids;
+ uuid_vec_t no_ids;
return newSession(session_id, name, type, other_participant_id, no_ids, voice);
}
@@ -1002,7 +1024,7 @@ void LLIMModel::sendMessage(const std::string& utf8_text,
}
else
{
- for(std::vector<LLUUID>::iterator it = session->mInitialTargetIDs.begin();
+ for(uuid_vec_t::iterator it = session->mInitialTargetIDs.begin();
it!=session->mInitialTargetIDs.end();++it)
{
const LLUUID id = *it;
@@ -1134,7 +1156,7 @@ private:
bool LLIMModel::sendStartSession(
const LLUUID& temp_session_id,
const LLUUID& other_participant_id,
- const std::vector<LLUUID>& ids,
+ const uuid_vec_t& ids,
EInstantMessage dialog)
{
if ( dialog == IM_SESSION_GROUP_START )
@@ -1544,6 +1566,11 @@ LLCallDialog::LLCallDialog(const LLSD& payload)
setDocked(true);
}
+LLCallDialog::~LLCallDialog()
+{
+ LLUI::removePopup(this);
+}
+
void LLCallDialog::getAllowedRect(LLRect& rect)
{
rect = gViewerWindow->getWorldViewRectScaled();
@@ -1597,7 +1624,7 @@ void LLCallDialog::onOpen(const LLSD& key)
LLDockableFloater::onOpen(key);
// it should be over the all floaters. EXT-5116
- gFloaterView->bringToFront(this, FALSE);
+ LLUI::addPopup(this);
}
void LLCallDialog::setIcon(const LLSD& session_id, const LLSD& participant_id)
@@ -1692,7 +1719,6 @@ void LLOutgoingCallDialog::show(const LLSD& key)
channel_name = LLTextUtil::formatPhoneNumber(channel_name);
}
childSetTextArg("nearby", "[VOICE_CHANNEL_NAME]", channel_name);
- childSetTextArg("nearby_P2P_by_other", "[VOICE_CHANNEL_NAME]", mPayload["disconnected_channel_name"].asString());
// skipping "You will now be reconnected to nearby" in notification when call is ended by disabling voice,
// so no reconnection to nearby chat happens (EXT-4397)
@@ -3057,7 +3083,7 @@ public:
return;
}
- if(!LLVoiceClient::voiceEnabled())
+ if(!LLVoiceClient::voiceEnabled() || !LLVoiceClient::getInstance()->voiceWorking())
{
// Don't display voice invites unless the user has voice enabled.
return;