summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llimfloater.cpp47
-rw-r--r--indra/newview/llimfloater.h1
-rw-r--r--indra/newview/llimview.cpp23
-rw-r--r--indra/newview/llimview.h3
-rw-r--r--indra/newview/llpanelimcontrolpanel.cpp12
-rw-r--r--indra/newview/llpanelplaceinfo.cpp3
-rw-r--r--indra/newview/llpanelplaceinfo.h3
-rw-r--r--indra/newview/skins/default/xui/en/strings.xml3
8 files changed, 84 insertions, 11 deletions
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index 9e92e2f490..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();
}
@@ -562,6 +575,30 @@ void LLIMFloater::processIMTyping(const LLIMInfo* im_info, BOOL typing)
}
}
+void LLIMFloater::processSessionUpdate(const LLSD& session_update)
+{
+ // *TODO : verify following code when moderated mode will be implemented
+ if ( false && session_update.has("moderated_mode") &&
+ session_update["moderated_mode"].has("voice") )
+ {
+ BOOL voice_moderated = session_update["moderated_mode"]["voice"];
+ const std::string session_label = LLIMModel::instance().getName(mSessionID);
+
+ if (voice_moderated)
+ {
+ setTitle(session_label + std::string(" ") + LLTrans::getString("IM_moderated_chat_label"));
+ }
+ else
+ {
+ setTitle(session_label);
+ }
+
+ // *TODO : uncomment this when/if LLPanelActiveSpeakers panel will be added
+ //update the speakers dropdown too
+ //mSpeakerPanel->setVoiceModerationCtrlMode(voice_moderated);
+ }
+}
+
void LLIMFloater::addTypingIndicator(const LLIMInfo* im_info)
{
// We may have lost a "stop-typing" packet, don't add it twice
diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h
index 3559e14c89..4097f11f56 100644
--- a/indra/newview/llimfloater.h
+++ b/indra/newview/llimfloater.h
@@ -88,6 +88,7 @@ public:
void onVisibilityChange(const LLSD& new_visibility);
void processIMTyping(const LLIMInfo* im_info, BOOL typing);
+ void processSessionUpdate(const LLSD& session_update);
private:
// process focus events to set a currently active session
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 2e5e23c845..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);
}
}
@@ -2120,6 +2124,15 @@ public:
}
}
+ LLIMFloater* im_floater = LLIMFloater::findInstance(session_id);
+ if ( im_floater )
+ {
+ if ( body.has("session_info") )
+ {
+ im_floater->processSessionUpdate(body["session_info"]);
+ }
+ }
+
gIMMgr->clearPendingAgentListUpdates(session_id);
}
else
@@ -2217,11 +2230,17 @@ public:
const LLSD& context,
const LLSD& input) const
{
- LLFloaterIMPanel* floaterp = gIMMgr->findFloaterBySession(input["body"]["session_id"].asUUID());
+ LLUUID session_id = input["body"]["session_id"].asUUID();
+ LLFloaterIMPanel* floaterp = gIMMgr->findFloaterBySession(session_id);
if (floaterp)
{
floaterp->processSessionUpdate(input["body"]["info"]);
}
+ LLIMFloater* im_floater = LLIMFloater::findInstance(session_id);
+ if ( im_floater )
+ {
+ im_floater->processSessionUpdate(input["body"]["info"]);
+ }
}
};
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/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp
index 15c420d496..d5e81ed13d 100644
--- a/indra/newview/llpanelplaceinfo.cpp
+++ b/indra/newview/llpanelplaceinfo.cpp
@@ -56,6 +56,7 @@
#include "llagentui.h"
#include "llavatarpropertiesprocessor.h"
#include "llcallbacklist.h"
+#include "llexpandabletextbox.h"
#include "llfloaterworldmap.h"
#include "llfloaterbuycurrency.h"
#include "llinventorymodel.h"
@@ -121,7 +122,7 @@ BOOL LLPanelPlaceInfo::postBuild()
mSnapshotCtrl = getChild<LLTextureCtrl>("logo");
mRegionName = getChild<LLTextBox>("region_title");
mParcelName = getChild<LLTextBox>("parcel_title");
- mDescEditor = getChild<LLTextEditor>("description");
+ mDescEditor = getChild<LLExpandableTextBox>("description");
mMaturityRatingText = getChild<LLTextBox>("maturity_value");
mParcelOwner = getChild<LLTextBox>("owner_value");
diff --git a/indra/newview/llpanelplaceinfo.h b/indra/newview/llpanelplaceinfo.h
index 4274baa66e..07a2434d59 100644
--- a/indra/newview/llpanelplaceinfo.h
+++ b/indra/newview/llpanelplaceinfo.h
@@ -43,6 +43,7 @@
class LLButton;
class LLComboBox;
+class LLExpandableTextBox;
class LLInventoryItem;
class LLLineEditor;
class LLPanelPickEdit;
@@ -164,7 +165,7 @@ private:
LLTextureCtrl* mSnapshotCtrl;
LLTextBox* mRegionName;
LLTextBox* mParcelName;
- LLTextEditor* mDescEditor;
+ LLExpandableTextBox*mDescEditor;
LLTextBox* mMaturityRatingText;
LLTextBox* mParcelOwner;
LLTextBox* mLastVisited;
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 1df5a8ca1a..35d6478c48 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -2884,6 +2884,9 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
<string name="IM_logging_string">-- Instant message logging enabled --</string>
<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">
Joining Voice Chat...