diff options
author | James Cook <james@lindenlab.com> | 2010-04-28 23:11:39 -0700 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2010-04-28 23:11:39 -0700 |
commit | 1d8efc3701e0a22821f1bc9f7a98dff994297a7b (patch) | |
tree | 82c64a29a35b8a387038dfbe4be134d7f54c20ff /indra | |
parent | 8fae11ee368e5b1dce858cdd698714384430858b (diff) |
DEV-49513 Viewer speaks final People API set display name format
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llviewerdisplayname.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp index 9250117581..4d243ce5ae 100644 --- a/indra/newview/llviewerdisplayname.cpp +++ b/indra/newview/llviewerdisplayname.cpp @@ -75,16 +75,31 @@ void LLViewerDisplayName::set(const std::string& display_name, const set_name_sl return; } + // People API requires both the old and new value to change a variable. + // Our display name will be in cache before the viewer's UI is available + // to request a change, so we can use direct lookup without callback. + LLAvatarName av_name; + if (!LLAvatarNameCache::get( gAgent.getID(), &av_name)) + { + slot(false, "name unavailable", LLSD()); + return; + } + + // People API expects array of [ "old value", "new value" ] + LLSD change_array = LLSD::emptyArray(); + change_array.append(av_name.mDisplayName); + change_array.append(display_name); + llinfos << "Set name POST to " << cap_url << llendl; // Record our caller for when the server sends back a reply sSetDisplayNameSignal.connect(slot); - + // POST the requested change. The sim will not send a response back to // this request directly, rather it will send a separate message after it // communicates with the back-end. LLSD body; - body["display_name"] = display_name; + body["display_name"] = change_array; LLHTTPClient::post(cap_url, body, new LLSetDisplayNameResponder); } |