summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorDmitry Zaporozhan <dzaporozhan@productengine.com>2009-10-28 16:52:47 +0200
committerDmitry Zaporozhan <dzaporozhan@productengine.com>2009-10-28 16:52:47 +0200
commit0e4f48950be95430a1a6052cd41790d807c31216 (patch)
tree21189e9bb7904e9f35ff97a31994fb22c8ecb974 /indra
parent515ce7fdbb2962f001d7d41b7ec628823ed0567d (diff)
parenta999e50a8ebb3ab641490294d67dbbd6eb0c8898 (diff)
Merge
--HG-- branch : product-engine
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llimfloater.cpp23
-rw-r--r--indra/newview/llimview.cpp6
-rw-r--r--indra/newview/llimview.h3
-rw-r--r--indra/newview/llpanelimcontrolpanel.cpp12
-rw-r--r--indra/newview/skins/default/xui/en/strings.xml1
5 files changed, 37 insertions, 8 deletions
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index b8b0290b18..2f060acb50 100644
--- a/indra/newview/llimfloater.cpp
+++ b/indra/newview/llimfloater.cpp
@@ -240,6 +240,15 @@ BOOL LLIMFloater::postBuild()
mTypingStart = LLTrans::getString("IM_typing_start_string");
+ // Disable input editor if session cannot accept text
+ LLIMModel::LLIMSession* im_session =
+ LLIMModel::instance().findIMSession(mSessionID);
+ if( im_session && !im_session->mTextIMPossible )
+ {
+ mInputEditor->setEnabled(FALSE);
+ mInputEditor->setLabel(LLTrans::getString("IM_unavailable_text_label"));
+ }
+
//*TODO if session is not initialized yet, add some sort of a warning message like "starting session...blablabla"
//see LLFloaterIMPanel for how it is done (IB)
@@ -249,8 +258,6 @@ BOOL LLIMFloater::postBuild()
// virtual
void LLIMFloater::draw()
{
-
-
if ( mMeTyping )
{
// Time out if user hasn't typed for a while.
@@ -259,6 +266,7 @@ void LLIMFloater::draw()
setTyping(false);
}
}
+
LLFloater::draw();
}
@@ -474,9 +482,14 @@ void LLIMFloater::onInputEditorFocusReceived( LLFocusableElement* caller, void*
{
LLIMFloater* self= (LLIMFloater*) userdata;
- //in disconnected state IM input editor should be disabled
- self->mInputEditor->setEnabled(!gDisconnected);
-
+ // Allow enabling the LLIMFloater input editor only if session can accept text
+ LLIMModel::LLIMSession* im_session =
+ LLIMModel::instance().findIMSession(self->mSessionID);
+ if( im_session && im_session->mTextIMPossible )
+ {
+ //in disconnected state IM input editor should be disabled
+ self->mInputEditor->setEnabled(!gDisconnected);
+ }
self->mChatHistory->setCursorAndScrollToEnd();
}
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index a716145590..b429ae8cf4 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -146,7 +146,9 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string&
mVoiceChannel(NULL),
mSpeakers(NULL),
mSessionInitialized(false),
- mCallBackEnabled(true)
+ mCallBackEnabled(true),
+ mTextIMPossible(true),
+ mProfileButtonEnabled(true)
{
if (IM_NOTHING_SPECIAL == type || IM_SESSION_P2P_INVITE == type)
{
@@ -174,6 +176,8 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string&
if (IM_NOTHING_SPECIAL == type)
{
mCallBackEnabled = LLVoiceClient::getInstance()->isSessionCallBackPossible(mSessionID);
+ mTextIMPossible = LLVoiceClient::getInstance()->isSessionTextIMPossible(mSessionID);
+ mProfileButtonEnabled = LLVoiceClient::getInstance()->isParticipantAvatar(mSessionID);
}
}
diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h
index f09c5a9521..80b54d7ef0 100644
--- a/indra/newview/llimview.h
+++ b/indra/newview/llimview.h
@@ -74,6 +74,9 @@ public:
//true if calling back the session URI after the session has closed is possible.
//Currently this will be false only for PSTN P2P calls.
bool mCallBackEnabled;
+
+ bool mTextIMPossible;
+ bool mProfileButtonEnabled;
};
diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp
index 6678a3a460..c70d903fb0 100644
--- a/indra/newview/llpanelimcontrolpanel.cpp
+++ b/indra/newview/llpanelimcontrolpanel.cpp
@@ -130,12 +130,20 @@ void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id)
{
LLPanelChatControlPanel::setSessionId(session_id);
- LLUUID avatar_id = LLIMModel::getInstance()->getOtherParticipantID(session_id);
+ LLIMModel& im_model = LLIMModel::instance();
+
+ LLUUID avatar_id = im_model.getOtherParticipantID(session_id);
// Disable "Add friend" button for friends.
childSetEnabled("add_friend_btn", !LLAvatarActions::isFriend(avatar_id));
-
+
getChild<LLAvatarIconCtrl>("avatar_icon")->setValue(avatar_id);
+
+ // Disable profile button if participant is not realy SL avatar
+ LLIMModel::LLIMSession* im_session =
+ im_model.findIMSession(session_id);
+ if( im_session && !im_session->mProfileButtonEnabled )
+ childSetEnabled("view_profile_btn", FALSE);
}
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 7e9585d4bd..8609d07be9 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -2885,6 +2885,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
<string name="IM_typing_start_string">[NAME] is typing...</string>
<string name="Unnamed">(Unnamed)</string>
<string name="IM_moderated_chat_label">(Moderated: Voices off by default)</string>
+ <string name="IM_unavailable_text_label">Text chat is not available for this call.</string>
<string name="ringing-im">