summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llappviewer.cpp1
-rw-r--r--indra/newview/llfloateravatarpicker.cpp150
-rw-r--r--indra/newview/llfloateravatarpicker.h3
-rw-r--r--indra/newview/llfloaterimcontainer.cpp5
-rw-r--r--indra/newview/llselectmgr.cpp1
-rw-r--r--indra/newview/lltooldraganddrop.cpp2
-rw-r--r--indra/newview/llvoicevivox.cpp1
-rw-r--r--indra/newview/llvoicewebrtc.cpp57
-rw-r--r--indra/newview/llvoicewebrtc.h1
-rw-r--r--indra/newview/skins/default/xui/en/strings.xml1
10 files changed, 175 insertions, 47 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index eadc5e7e63..bfd8b1dcc7 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -2398,7 +2398,6 @@ void LLAppViewer::initLoggingAndGetLastDuration()
if (gDirUtilp->fileExists(user_data_path_cef_log))
{
std::string user_data_path_cef_old = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "cef.old");
- LLFile::remove(user_data_path_cef_old, ENOENT);
LLFile::rename(user_data_path_cef_log, user_data_path_cef_old);
}
}
diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp
index 08a54b7369..fd9bbf00ae 100644
--- a/indra/newview/llfloateravatarpicker.cpp
+++ b/indra/newview/llfloateravatarpicker.cpp
@@ -34,6 +34,7 @@
#include "llfloaterreg.h"
#include "llimview.h" // for gIMMgr
#include "lltooldraganddrop.h" // for LLToolDragAndDrop
+#include "lltrans.h"
#include "llviewercontrol.h"
#include "llviewerregion.h" // getCapability()
#include "llworld.h"
@@ -405,15 +406,50 @@ bool LLFloaterAvatarPicker::visibleItemsSelected() const
}
/*static*/
-void LLFloaterAvatarPicker::findCoro(std::string url, LLUUID queryID, std::string name)
+void LLFloaterAvatarPicker::findByIdCoro(std::string url, LLUUID query_id, LLUUID agent_id, std::string floater_key)
{
LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID);
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
- httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("genericPostCoro", httpPolicy));
+ httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("findByIdCoro", httpPolicy));
LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions);
- LL_INFOS("HttpCoroutineAdapter", "genericPostCoro") << "Generic POST for " << url << LL_ENDL;
+ httpOpts->setTimeout(AVATAR_PICKER_SEARCH_TIMEOUT);
+
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, url, httpOpts);
+
+ LL_DEBUGS("Agent") << result << LL_ENDL;
+
+ LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
+ LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
+
+ if (status || (status == LLCore::HttpStatus(HTTP_BAD_REQUEST)))
+ {
+ result.erase(LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS);
+ }
+ else
+ {
+ result["failure_reason"] = status.toString();
+ }
+
+ LLFloaterAvatarPicker* floater =
+ LLFloaterReg::findTypedInstance<LLFloaterAvatarPicker>("avatar_picker", floater_key);
+ if (floater)
+ {
+ floater->processResponse(query_id, result);
+ }
+}
+
+/*static*/
+void LLFloaterAvatarPicker::findByNameCoro(std::string url, LLUUID queryID, std::string name)
+{
+ LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID);
+ LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
+ httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("findByNameCoro", httpPolicy));
+ LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
+ LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions);
+
+ LL_INFOS("HttpCoroutineAdapter", "genericPostCoro", "Agent") << "Generic POST for " << url << LL_ENDL;
httpOpts->setTimeout(AVATAR_PICKER_SEARCH_TIMEOUT);
@@ -447,6 +483,7 @@ void LLFloaterAvatarPicker::find()
std::string text = getChild<LLUICtrl>("Edit")->getValue().asString();
+ LLUUID agent_id;
size_t separator_index = text.find_first_of(" ._");
if (separator_index != text.npos)
{
@@ -458,51 +495,92 @@ void LLFloaterAvatarPicker::find()
text = first;
}
}
+ else if (!text.empty())
+ {
+ agent_id.set(text);
+ }
mQueryID.generate();
+ mNumResultsReturned = 0;
- std::string url;
- url.reserve(128); // avoid a memory allocation or two
+ getChild<LLScrollListCtrl>("SearchResults")->deleteAllItems();
+ getChild<LLScrollListCtrl>("SearchResults")->setCommentText(getString("searching"));
+ getChildView("ok_btn")->setEnabled(false);
- LLViewerRegion* region = gAgent.getRegion();
- if(region)
+ if (agent_id.notNull())
{
- url = region->getCapability("AvatarPickerSearch");
- // Prefer use of capabilities to search on both SLID and display name
- if (!url.empty())
+ // Search by uuid
+ // While cache could have been nicer, it neither has a failure callback, nor
+ // can cleanup in case of an invalid uuid. So we go directly to the capability.
+ LLViewerRegion* region = gAgent.getRegion();
+ if (region)
{
- // capability urls don't end in '/', but we need one to parse
- // query parameters correctly
- if (url.size() > 0 && url[url.size()-1] != '/')
+ std::string url;
+ url.reserve(128);
+ url = region->getCapability("GetDisplayNames");
+ if (!url.empty())
{
- url += "/";
- }
- url += "?page_size=100&names=";
- std::replace(text.begin(), text.end(), '.', ' ');
- url += LLURI::escape(text);
- LL_INFOS() << "avatar picker " << url << LL_ENDL;
+ // capability urls don't end in '/', but we need one to parse
+ // query parameters correctly
+ if (url[url.size() - 1] != '/')
+ {
+ url += "/";
+ }
+ url += "?ids=";
+ url += agent_id.asString();
+ LL_DEBUGS("Agent") << "avatar picker " << url << LL_ENDL;
- LLCoros::instance().launch("LLFloaterAvatarPicker::findCoro",
- boost::bind(&LLFloaterAvatarPicker::findCoro, url, mQueryID, getKey().asString()));
+ LLCoros::instance().launch("LLFloaterAvatarPicker::findCoro",
+ boost::bind(&LLFloaterAvatarPicker::findByIdCoro, url, mQueryID, agent_id, getKey().asString()));
+ }
+ else
+ {
+ LLSD content;
+ content["failure_reason"] = LLTrans::getString("ServerUnavailable");
+ processResponse(mQueryID, content);
+ }
}
- else
+ }
+ else
+ {
+ std::string url;
+ url.reserve(128); // avoid a memory allocation or two
+
+ LLViewerRegion* region = gAgent.getRegion();
+ if (region)
{
- LLMessageSystem* msg = gMessageSystem;
- msg->newMessage("AvatarPickerRequest");
- msg->nextBlock("AgentData");
- msg->addUUID("AgentID", gAgent.getID());
- msg->addUUID("SessionID", gAgent.getSessionID());
- msg->addUUID("QueryID", mQueryID); // not used right now
- msg->nextBlock("Data");
- msg->addString("Name", text);
- gAgent.sendReliableMessage();
+ url = region->getCapability("AvatarPickerSearch");
+ // Prefer use of capabilities to search on both SLID and display name
+ if (!url.empty())
+ {
+ // capability urls don't end in '/', but we need one to parse
+ // query parameters correctly
+ if (url.size() > 0 && url[url.size() - 1] != '/')
+ {
+ url += "/";
+ }
+ url += "?page_size=100&names=";
+ std::replace(text.begin(), text.end(), '.', ' ');
+ url += LLURI::escape(text);
+ LL_DEBUGS("Agent") << "avatar picker " << url << LL_ENDL;
+
+ LLCoros::instance().launch("LLFloaterAvatarPicker::findCoro",
+ boost::bind(&LLFloaterAvatarPicker::findByNameCoro, url, mQueryID, getKey().asString()));
+ }
+ else
+ {
+ LLMessageSystem* msg = gMessageSystem;
+ msg->newMessage("AvatarPickerRequest");
+ msg->nextBlock("AgentData");
+ msg->addUUID("AgentID", gAgent.getID());
+ msg->addUUID("SessionID", gAgent.getSessionID());
+ msg->addUUID("QueryID", mQueryID); // not used right now
+ msg->nextBlock("Data");
+ msg->addString("Name", text);
+ gAgent.sendReliableMessage();
+ }
}
}
- getChild<LLScrollListCtrl>("SearchResults")->deleteAllItems();
- getChild<LLScrollListCtrl>("SearchResults")->setCommentText(getString("searching"));
-
- getChildView("ok_btn")->setEnabled(false);
- mNumResultsReturned = 0;
}
void LLFloaterAvatarPicker::setAllowMultiple(bool allow_multiple)
diff --git a/indra/newview/llfloateravatarpicker.h b/indra/newview/llfloateravatarpicker.h
index 330f1a1226..817427aae6 100644
--- a/indra/newview/llfloateravatarpicker.h
+++ b/indra/newview/llfloateravatarpicker.h
@@ -86,7 +86,8 @@ private:
void populateFriend();
bool visibleItemsSelected() const; // Returns true if any items in the current tab are selected.
- static void findCoro(std::string url, LLUUID mQueryID, std::string mName);
+ static void findByIdCoro(std::string url, LLUUID query_id, LLUUID agent_id, std::string floater_key);
+ static void findByNameCoro(std::string url, LLUUID mQueryID, std::string mName);
void find();
void setAllowMultiple(bool allow_multiple);
LLScrollListCtrl* getActiveList();
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index 2b9fb9dd37..c25fbdcc51 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -1721,6 +1721,11 @@ void LLFloaterIMContainer::showConversation(const LLUUID& session_id)
if (session_floater)
{
session_floater->restoreFloater();
+ if (session_floater->isTornOff() && session_floater->isMinimized())
+ {
+ session_floater->setMinimized(false);
+ session_floater->setFocus(true);
+ }
}
}
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index be4b449e2a..4762fc555d 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -2073,7 +2073,6 @@ bool LLSelectMgr::selectionSetGLTFMaterial(const LLUUID& mat_id)
objectp->clearTEWaterExclusion(te);
// Blank out most override data on the object and send to server
- objectp->setRenderMaterialID(te, asset_id);
if (should_preserve_transforms && preserved_override)
{
// Apply material with preserved transforms
diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp
index d0c0bdb5ce..f78ff2226c 100644
--- a/indra/newview/lltooldraganddrop.cpp
+++ b/indra/newview/lltooldraganddrop.cpp
@@ -1537,7 +1537,7 @@ void LLToolDragAndDrop::dropMaterialAllFaces(LLViewerObject* hit_obj,
}
else
{
- hit_obj->setRenderMaterialID(te, asset_id, false, true);
+ hit_obj->setRenderMaterialID(te, asset_id);
}
}
}
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index 6d29038a23..8792ae3285 100644
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -1014,7 +1014,6 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon()
std::string old_log = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SLVoice.old");
if (gDirUtilp->fileExists(new_log))
{
- LLFile::remove(old_log, ENOENT);
LLFile::rename(new_log, old_log);
}
diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp
index e6fcc7bd6b..93f8f0d14a 100644
--- a/indra/newview/llvoicewebrtc.cpp
+++ b/indra/newview/llvoicewebrtc.cpp
@@ -396,7 +396,7 @@ void LLWebRTCVoiceClient::updateSettings()
config.mNoiseSuppressionLevel = noiseSuppressionLevel;
audioConfigChanged = true;
}
- if (audioConfigChanged)
+ if (audioConfigChanged && mWebRTCDeviceInterface)
{
mWebRTCDeviceInterface->setAudioConfig(config);
}
@@ -699,6 +699,7 @@ void LLWebRTCVoiceClient::setCaptureDevice(const std::string& name)
{
if (mWebRTCDeviceInterface)
{
+ LL_DEBUGS("Voice") << "new capture device is " << name << LL_ENDL;
mWebRTCDeviceInterface->setCaptureDevice(name);
}
}
@@ -727,10 +728,15 @@ void LLWebRTCVoiceClient::OnDevicesChangedImpl(const llwebrtc::LLWebRTCVoiceDevi
return;
}
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE;
+
+ LL_DEBUGS("Voice") << "Reiniting " << LL_ENDL;
+
std::string inputDevice = gSavedSettings.getString("VoiceInputAudioDevice");
std::string outputDevice = gSavedSettings.getString("VoiceOutputAudioDevice");
LL_DEBUGS("Voice") << "Setting devices to-input: '" << inputDevice << "' output: '" << outputDevice << "'" << LL_ENDL;
+ bool update_render = false;
+ bool update_capture = false;
// only set the render device if the device list has changed.
if (mRenderDevices.size() != render_devices.size() || !std::equal(mRenderDevices.begin(),
@@ -744,7 +750,7 @@ void LLWebRTCVoiceClient::OnDevicesChangedImpl(const llwebrtc::LLWebRTCVoiceDevi
{
addRenderDevice(LLVoiceDevice(device.mDisplayName, device.mID));
}
- setRenderDevice(outputDevice);
+ update_render = true;
}
// only set the capture device if the device list has changed.
@@ -761,6 +767,22 @@ void LLWebRTCVoiceClient::OnDevicesChangedImpl(const llwebrtc::LLWebRTCVoiceDevi
addCaptureDevice(LLVoiceDevice(device.mDisplayName, device.mID));
}
+ update_capture = true;
+ }
+
+ if (update_render && update_capture)
+ {
+ // Do both in one go to avoid multiple deployDevices calls.
+ // And to avoid situation where workerDeployDevices has an
+ // obsolete device id
+ setDevices(inputDevice, outputDevice);
+ }
+ else if (update_render)
+ {
+ setRenderDevice(outputDevice);
+ }
+ else if (update_capture)
+ {
setCaptureDevice(inputDevice);
}
@@ -789,15 +811,28 @@ void LLWebRTCVoiceClient::setRenderDevice(const std::string& name)
{
if (mWebRTCDeviceInterface)
{
+ LL_DEBUGS("Voice") << "new render device is " << name << LL_ENDL;
mWebRTCDeviceInterface->setRenderDevice(name);
}
}
+void LLWebRTCVoiceClient::setDevices(const std::string& capture_name, const std::string& render_name)
+{
+ if (mWebRTCDeviceInterface)
+ {
+ LL_DEBUGS("Voice") << "new capture device: " << capture_name << " New render device: " << render_name << LL_ENDL;
+ mWebRTCDeviceInterface->setDevices(capture_name, render_name);
+ }
+}
+
void LLWebRTCVoiceClient::tuningStart()
{
if (!mIsInTuningMode)
{
- mWebRTCDeviceInterface->setTuningMode(true);
+ if (mWebRTCDeviceInterface)
+ {
+ mWebRTCDeviceInterface->setTuningMode(true);
+ }
mIsInTuningMode = true;
}
}
@@ -806,7 +841,10 @@ void LLWebRTCVoiceClient::tuningStop()
{
if (mIsInTuningMode)
{
- mWebRTCDeviceInterface->setTuningMode(false);
+ if (mWebRTCDeviceInterface)
+ {
+ mWebRTCDeviceInterface->setTuningMode(false);
+ }
mIsInTuningMode = false;
}
}
@@ -839,6 +877,10 @@ void LLWebRTCVoiceClient::tuningSetSpeakerVolume(float volume)
float LLWebRTCVoiceClient::tuningGetEnergy(void)
{
+ if (!mWebRTCDeviceInterface)
+ {
+ return 0.f;
+ }
float rms = mWebRTCDeviceInterface->getTuningAudioLevel();
return TUNING_LEVEL_START_POINT - TUNING_LEVEL_SCALE * rms;
}
@@ -866,7 +908,10 @@ void LLWebRTCVoiceClient::refreshDeviceLists(bool clearCurrentList)
clearCaptureDevices();
clearRenderDevices();
}
- mWebRTCDeviceInterface->refreshDevices();
+ if (mWebRTCDeviceInterface)
+ {
+ mWebRTCDeviceInterface->refreshDevices();
+ }
}
@@ -1174,7 +1219,7 @@ void LLWebRTCVoiceClient::sendPositionUpdate(bool force)
void LLWebRTCVoiceClient::updateOwnVolume()
{
F32 audio_level = 0.0f;
- if (!mMuteMic)
+ if (!mMuteMic && mWebRTCDeviceInterface)
{
float rms = mWebRTCDeviceInterface->getPeerConnectionAudioLevel();
audio_level = LEVEL_START_POINT - LEVEL_SCALE * rms;
diff --git a/indra/newview/llvoicewebrtc.h b/indra/newview/llvoicewebrtc.h
index 2ce575852a..54d8e54ce2 100644
--- a/indra/newview/llvoicewebrtc.h
+++ b/indra/newview/llvoicewebrtc.h
@@ -124,6 +124,7 @@ public:
void setCaptureDevice(const std::string& name) override;
void setRenderDevice(const std::string& name) override;
+ void setDevices(const std::string& capture_name, const std::string& render_name);
LLVoiceDeviceList& getCaptureDevices() override;
LLVoiceDeviceList& getRenderDevices() override;
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 99c7d7b7d4..8e0eea97d1 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -327,6 +327,7 @@ are allowed.
<!-- searching - generic -->
<string name="Searching">Searching...</string>
<string name="NoneFound">None found.</string>
+ <string name="ServerUnavailable">Service not available.</string>
<!-- Indicates that an avatar name or other similar datum is being retrieved. General usage. -->
<string name="RetrievingData">Retrieving...</string>