summaryrefslogtreecommitdiff
path: root/indra/llmessage/llavatarnamecache.cpp
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2010-03-18 17:19:57 -0700
committerJames Cook <james@lindenlab.com>2010-03-18 17:19:57 -0700
commit639b234762133e4d09d6d7b1bac9d25c5a681926 (patch)
treed99a727f3fa9c53faecd434b2735da1094b9a519 /indra/llmessage/llavatarnamecache.cpp
parent10fc6ee4a012fa7232868261d6e11a76652c3cca (diff)
Partial support for Set Name returning error msg from service
Diffstat (limited to 'indra/llmessage/llavatarnamecache.cpp')
-rw-r--r--indra/llmessage/llavatarnamecache.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp
index d7284c41a7..d49f1d3de5 100644
--- a/indra/llmessage/llavatarnamecache.cpp
+++ b/indra/llmessage/llavatarnamecache.cpp
@@ -37,6 +37,7 @@
#include "llcachename.h" // *TODO: remove
#include "llframetimer.h"
#include "llhttpclient.h"
+#include "llsd.h"
#include <map>
#include <set>
@@ -266,23 +267,36 @@ class LLSetNameResponder : public LLHTTPClient::Responder
{
public:
LLUUID mAgentID;
+ LLAvatarNameCache::set_name_signal_t mSignal;
- LLSetNameResponder(const LLUUID& agent_id) : mAgentID(agent_id) { }
+ LLSetNameResponder(const LLUUID& agent_id,
+ const LLAvatarNameCache::set_name_slot_t& slot)
+ : mAgentID(agent_id),
+ mSignal()
+ {
+ mSignal.connect(slot);
+ }
/*virtual*/ void result(const LLSD& content)
{
// force re-fetch
LLAvatarNameCache::sCache.erase(mAgentID);
+
+ mSignal(true, "", content);
}
/*virtual*/ void error(U32 status, const std::string& reason)
{
llinfos << "JAMESDEBUG set names failed " << status
<< " reason " << reason << llendl;
+
+ mSignal(false, reason, LLSD());
}
};
-void LLAvatarNameCache::setDisplayName(const LLUUID& agent_id, const std::string& display_name)
+void LLAvatarNameCache::setDisplayName(const LLUUID& agent_id,
+ const std::string& display_name,
+ const set_name_slot_t& slot)
{
LLSD body;
body["display_name"] = display_name;
@@ -291,7 +305,7 @@ void LLAvatarNameCache::setDisplayName(const LLUUID& agent_id, const std::string
std::string url = sNameServiceBaseURL + "agent/";
url += agent_id.asString();
url += "/set-display-name/";
- LLHTTPClient::post(url, body, new LLSetNameResponder(agent_id));
+ LLHTTPClient::post(url, body, new LLSetNameResponder(agent_id, slot));
}
void LLAvatarNameCache::toggleDisplayNames()