summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llimview.cpp21
-rw-r--r--indra/newview/llimview.h18
-rw-r--r--indra/newview/skins/default/xui/en/strings.xml3
3 files changed, 42 insertions, 0 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index b3f085ef6d..2dfc57532a 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -80,6 +80,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 +94,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"])
@@ -214,6 +230,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)
{
diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h
index e7404074e0..c4a8dd076e 100644
--- a/indra/newview/llimview.h
+++ b/indra/newview/llimview.h
@@ -34,6 +34,7 @@
#define LL_LLIMVIEW_H
#include "lldockablefloater.h"
+#include "lleventtimer.h"
#include "llinstantmessage.h"
#include "lllogchat.h"
@@ -45,7 +46,24 @@ class LLFriendObserver;
class LLCallDialogManager;
class LLIMSpeakerMgr;
+/**
+ * Timeout Timer for outgoing Ad-Hoc/Group IM sessions which being initialized by the server
+ */
+class LLSessionTimeoutTimer : public LLEventTimer
+{
+public:
+ LLSessionTimeoutTimer(const LLUUID& session_id, F32 period) : LLEventTimer(period), mSessionId(session_id) {}
+ virtual ~LLSessionTimeoutTimer() {};
+ /* virtual */ BOOL tick();
+
+private:
+ LLUUID mSessionId;
+};
+
+/**
+ * Model (MVC) for IM Sessions
+ */
class LLIMModel : public LLSingleton<LLIMModel>
{
public:
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 1eaf77c328..485db0080d 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -3015,4 +3015,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
<string name="unread_chat_multiple">
[SOURCES] have said something new
</string>"
+ <string name="session_initialization_timed_out_error">
+ The session initialization is timed out
+ </string>
</strings>