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.cpp43
1 files changed, 35 insertions, 8 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 7a4febec20..e0f155a6a9 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)
{
@@ -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 )
@@ -1538,6 +1560,11 @@ LLCallDialog::LLCallDialog(const LLSD& payload)
setDocked(true);
}
+LLCallDialog::~LLCallDialog()
+{
+ LLUI::removePopup(this);
+}
+
void LLCallDialog::getAllowedRect(LLRect& rect)
{
rect = gViewerWindow->getWorldViewRectScaled();
@@ -1591,7 +1618,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)