From d2f9e34598621f1dabad15025417efd6b81dddf0 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 23 Mar 2010 11:41:33 -0700 Subject: Part DEV-47695 route display name changes via sim for rebroadcast to nearby avatars for name tag updates and to update cached display name for LSL nonblocking functions --- indra/newview/llviewerdisplayname.cpp | 140 ++++++++++++++++++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 indra/newview/llviewerdisplayname.cpp (limited to 'indra/newview/llviewerdisplayname.cpp') diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp new file mode 100644 index 0000000000..587d745e51 --- /dev/null +++ b/indra/newview/llviewerdisplayname.cpp @@ -0,0 +1,140 @@ +/** + * @file llviewerdisplayname.cpp + * @brief Wrapper for display name functionality + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ +#include "llviewerprecompiledheaders.h" + +#include "llviewerdisplayname.h" + +// viewer includes +#include "llagent.h" +#include "llviewerregion.h" +#include "llvoavatar.h" + +// library includes +#include "llavatarnamecache.h" +#include "llhttpclient.h" +#include "llhttpnode.h" + +namespace LLViewerDisplayName +{ + // Fired when viewer receives server response to display name change + set_name_signal_t sSetDisplayNameSignal; +} + +class LLSetDisplayNameResponder : public LLHTTPClient::Responder +{ +public: + // only care about errors + /*virtual*/ void error(U32 status, const std::string& reason) + { + LLViewerDisplayName::sSetDisplayNameSignal(false, "", LLSD()); + LLViewerDisplayName::sSetDisplayNameSignal.disconnect_all_slots(); + } +}; + +void LLViewerDisplayName::set(const std::string& display_name, const set_name_slot_t& slot) +{ + // TODO: simple validation here + + LLViewerRegion* region = gAgent.getRegion(); + llassert(region); + std::string cap_url = region->getCapability("SetDisplayName"); + if (cap_url.empty()) + { + // this server does not support display names, report error + slot(false, "unsupported", LLSD()); + return; + } + + llinfos << "JAMESDEBUG 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; + LLHTTPClient::post(cap_url, body, new LLSetDisplayNameResponder); +} + +class LLSetDisplayNameReply : public LLHTTPNode +{ + /*virtual*/ void post( + LLHTTPNode::ResponsePtr response, + const LLSD& context, + const LLSD& input) const + { + LLSD body = input["body"]; + + S32 status = body["status"].asInteger(); + bool success = (status == 200); + std::string reason = body["reason"].asString(); + LLSD content = body["content"]; + + llinfos << "JAMESDEBUG LLSetDisplayNameReply status " << status + << " reason " << reason << llendl; + + // inform caller of result + LLViewerDisplayName::sSetDisplayNameSignal(success, reason, content); + LLViewerDisplayName::sSetDisplayNameSignal.disconnect_all_slots(); + } +}; + +class LLDisplayNameUpdate : public LLHTTPNode +{ + /*virtual*/ void post( + LLHTTPNode::ResponsePtr response, + const LLSD& context, + const LLSD& input) const + { + LLSD body = input["body"]; + LLUUID agent_id = body["agent_id"]; + + llinfos << "JAMESDEBUG LLDisplayNameUpdate agent_id " + << agent_id << llendl; + + // force re-request of this agent's name data + LLAvatarNameCache::erase(agent_id); + + // force name tag to update + LLVOAvatar::invalidateNameTag(agent_id); + } +}; + +LLHTTPRegistration + gHTTPRegistrationMessageSetDisplayNameReply( + "/message/SetDisplayNameReply"); + +LLHTTPRegistration + gHTTPRegistrationMessageDisplayNameUpdate( + "/message/DisplayNameUpdate"); -- cgit v1.2.3 From 0c89242b4ca4cd99baee41f4b1ca8f1817f6012e Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 30 Mar 2010 09:36:43 -0700 Subject: Demo code - name changes work on agni again --- indra/newview/llviewerdisplayname.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'indra/newview/llviewerdisplayname.cpp') diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp index 587d745e51..62fbf85985 100644 --- a/indra/newview/llviewerdisplayname.cpp +++ b/indra/newview/llviewerdisplayname.cpp @@ -69,12 +69,16 @@ void LLViewerDisplayName::set(const std::string& display_name, const set_name_sl std::string cap_url = region->getCapability("SetDisplayName"); if (cap_url.empty()) { - // this server does not support display names, report error - slot(false, "unsupported", LLSD()); + // JAMESDEBUG HACK for demos, fall back to prototype name service + LLAvatarNameCache::setDisplayName(gAgent.getID(), display_name, slot); return; + + // this server does not support display names, report error + //slot(false, "unsupported", LLSD()); + //return; } - llinfos << "JAMESDEBUG POST to " << cap_url << llendl; + llinfos << "Set name POST to " << cap_url << llendl; // Record our caller for when the server sends back a reply sSetDisplayNameSignal.connect(slot); -- cgit v1.2.3 From 1a7740f0143b7368cd24f44360fea37dcd23bad2 Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 12 Apr 2010 16:40:50 -0700 Subject: Added a touch of logging --- indra/newview/llviewerdisplayname.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llviewerdisplayname.cpp') diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp index 62fbf85985..84697f93b6 100644 --- a/indra/newview/llviewerdisplayname.cpp +++ b/indra/newview/llviewerdisplayname.cpp @@ -70,6 +70,7 @@ void LLViewerDisplayName::set(const std::string& display_name, const set_name_sl if (cap_url.empty()) { // JAMESDEBUG HACK for demos, fall back to prototype name service + llinfos << "Set name via legacy service" << llendl; LLAvatarNameCache::setDisplayName(gAgent.getID(), display_name, slot); return; -- cgit v1.2.3 From 60396971ca3e627fc4980a726f7d375bc570a2d2 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 13 Apr 2010 10:47:58 -0700 Subject: DEV-47529 Chat "foo changed name to bar" on name change, viewer piece Reviewed with Kelly --- indra/newview/llviewerdisplayname.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'indra/newview/llviewerdisplayname.cpp') diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp index 84697f93b6..9739c7fbc1 100644 --- a/indra/newview/llviewerdisplayname.cpp +++ b/indra/newview/llviewerdisplayname.cpp @@ -42,6 +42,7 @@ #include "llavatarnamecache.h" #include "llhttpclient.h" #include "llhttpnode.h" +#include "llnotificationsutil.h" namespace LLViewerDisplayName { @@ -124,15 +125,21 @@ class LLDisplayNameUpdate : public LLHTTPNode { LLSD body = input["body"]; LLUUID agent_id = body["agent_id"]; - - llinfos << "JAMESDEBUG LLDisplayNameUpdate agent_id " - << agent_id << llendl; + std::string slid = body["sl_id"]; + std::string old_display_name = body["old_display_name"]; + std::string new_display_name = body["new_display_name"]; // force re-request of this agent's name data LLAvatarNameCache::erase(agent_id); // force name tag to update LLVOAvatar::invalidateNameTag(agent_id); + + LLSD args; + args["OLD_NAME"] = old_display_name; + args["SLID"] = slid; + args["NEW_NAME"] = new_display_name; + LLNotificationsUtil::add("DisplayNameUpdate", args); } }; -- cgit v1.2.3 From fedfbbb8d8696044cace410365e348b20a1e2420 Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 15 Apr 2010 16:20:29 -0700 Subject: Remove hack to set display name by talking directly to name service This means display names will only work on grids with name code deployed --- indra/newview/llviewerdisplayname.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'indra/newview/llviewerdisplayname.cpp') diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp index 9739c7fbc1..1cfada48ad 100644 --- a/indra/newview/llviewerdisplayname.cpp +++ b/indra/newview/llviewerdisplayname.cpp @@ -70,14 +70,9 @@ void LLViewerDisplayName::set(const std::string& display_name, const set_name_sl std::string cap_url = region->getCapability("SetDisplayName"); if (cap_url.empty()) { - // JAMESDEBUG HACK for demos, fall back to prototype name service - llinfos << "Set name via legacy service" << llendl; - LLAvatarNameCache::setDisplayName(gAgent.getID(), display_name, slot); - return; - // this server does not support display names, report error - //slot(false, "unsupported", LLSD()); - //return; + slot(false, "unsupported", LLSD()); + return; } llinfos << "Set name POST to " << cap_url << llendl; -- cgit v1.2.3 From 98f5fc5ff006a82cacde47de0cbb564b6e703597 Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 22 Apr 2010 14:13:45 -0700 Subject: DEV-47529 Turn off display names if no capability from simulator, and Display name update broadcasts entire new name record to nearby viewers Display name update directly inserts new name into sim cache indra.xml has display_names_enabled setting to control cap Synchronized viewer and server versions of avatar name cache Reviewed with Ambroff --- indra/newview/llviewerdisplayname.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'indra/newview/llviewerdisplayname.cpp') diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp index 1cfada48ad..8bed501c6e 100644 --- a/indra/newview/llviewerdisplayname.cpp +++ b/indra/newview/llviewerdisplayname.cpp @@ -120,20 +120,22 @@ class LLDisplayNameUpdate : public LLHTTPNode { LLSD body = input["body"]; LLUUID agent_id = body["agent_id"]; - std::string slid = body["sl_id"]; std::string old_display_name = body["old_display_name"]; - std::string new_display_name = body["new_display_name"]; + // By convention this record is called "agent" in the People API + std::string name_data = body["agent"]; - // force re-request of this agent's name data - LLAvatarNameCache::erase(agent_id); + // Inject the new name data into cache + LLAvatarName av_name; + av_name.fromLLSD( name_data ); + LLAvatarNameCache::insert(agent_id, av_name); // force name tag to update LLVOAvatar::invalidateNameTag(agent_id); LLSD args; args["OLD_NAME"] = old_display_name; - args["SLID"] = slid; - args["NEW_NAME"] = new_display_name; + args["SLID"] = av_name.mSLID; + args["NEW_NAME"] = av_name.mDisplayName; LLNotificationsUtil::add("DisplayNameUpdate", args); } }; -- cgit v1.2.3 From 4b93f3d7b913afc32f3c65da6c29365560a40431 Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 22 Apr 2010 15:52:14 -0700 Subject: Fix typo in name change update code, now updates work --- indra/newview/llviewerdisplayname.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewerdisplayname.cpp') diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp index 8bed501c6e..2c0219cfbc 100644 --- a/indra/newview/llviewerdisplayname.cpp +++ b/indra/newview/llviewerdisplayname.cpp @@ -122,7 +122,7 @@ class LLDisplayNameUpdate : public LLHTTPNode LLUUID agent_id = body["agent_id"]; std::string old_display_name = body["old_display_name"]; // By convention this record is called "agent" in the People API - std::string name_data = body["agent"]; + LLSD name_data = body["agent"]; // Inject the new name data into cache LLAvatarName av_name; -- cgit v1.2.3 From af5dd4fbfa6fdee3d38167ec1153d01fd4265b35 Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 26 Apr 2010 14:20:07 -0700 Subject: Strip some debug spam --- indra/newview/llviewerdisplayname.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewerdisplayname.cpp') diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp index 2c0219cfbc..9250117581 100644 --- a/indra/newview/llviewerdisplayname.cpp +++ b/indra/newview/llviewerdisplayname.cpp @@ -90,6 +90,8 @@ void LLViewerDisplayName::set(const std::string& display_name, const set_name_sl class LLSetDisplayNameReply : public LLHTTPNode { + LOG_CLASS(LLSetDisplayNameReply); +public: /*virtual*/ void post( LLHTTPNode::ResponsePtr response, const LLSD& context, @@ -102,8 +104,7 @@ class LLSetDisplayNameReply : public LLHTTPNode std::string reason = body["reason"].asString(); LLSD content = body["content"]; - llinfos << "JAMESDEBUG LLSetDisplayNameReply status " << status - << " reason " << reason << llendl; + llinfos << "status " << status << " reason " << reason << llendl; // inform caller of result LLViewerDisplayName::sSetDisplayNameSignal(success, reason, content); -- cgit v1.2.3 From 1d8efc3701e0a22821f1bc9f7a98dff994297a7b Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 28 Apr 2010 23:11:39 -0700 Subject: DEV-49513 Viewer speaks final People API set display name format --- indra/newview/llviewerdisplayname.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewerdisplayname.cpp') 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); } -- cgit v1.2.3 From 3ba08e7149e215f4e169ff844e14bf22040735bf Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 29 Apr 2010 11:29:35 -0700 Subject: DEV-49489 Viewer supports People API set 409 Conflict error --- indra/newview/llviewerdisplayname.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'indra/newview/llviewerdisplayname.cpp') diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp index 4d243ce5ae..beb1dc9c82 100644 --- a/indra/newview/llviewerdisplayname.cpp +++ b/indra/newview/llviewerdisplayname.cpp @@ -121,6 +121,21 @@ public: llinfos << "status " << status << " reason " << reason << llendl; + // If viewer's concept of display name is out-of-date, the set request + // will fail with 409 Conflict. If that happens, fetch up-to-date + // name information. + if (status == 409) + { + LLUUID agent_id = gAgent.getID(); + // Flush stale data + LLAvatarNameCache::erase( agent_id ); + // Queue request for new data + LLAvatarName ignored; + LLAvatarNameCache::get( agent_id, &ignored ); + // Kill name tag, as it is wrong + LLVOAvatar::invalidateNameTag( agent_id ); + } + // inform caller of result LLViewerDisplayName::sSetDisplayNameSignal(success, reason, content); LLViewerDisplayName::sSetDisplayNameSignal.disconnect_all_slots(); -- cgit v1.2.3 From da723c27ca4cdd402af81a0b6f2545334119b98c Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 29 Apr 2010 17:13:56 -0700 Subject: Send Accept-Language header to localize set-display-name error msgs --- indra/newview/llviewerdisplayname.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewerdisplayname.cpp') diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp index beb1dc9c82..a6ac2587db 100644 --- a/indra/newview/llviewerdisplayname.cpp +++ b/indra/newview/llviewerdisplayname.cpp @@ -43,6 +43,7 @@ #include "llhttpclient.h" #include "llhttpnode.h" #include "llnotificationsutil.h" +#include "llui.h" // getLanguage() namespace LLViewerDisplayName { @@ -75,6 +76,11 @@ void LLViewerDisplayName::set(const std::string& display_name, const set_name_sl return; } + // People API can return localized error messages. Indicate our + // language preference via header. + LLSD headers; + headers["Accept-Language"] = LLUI::getLanguage(); + // 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. @@ -100,7 +106,7 @@ void LLViewerDisplayName::set(const std::string& display_name, const set_name_sl // communicates with the back-end. LLSD body; body["display_name"] = change_array; - LLHTTPClient::post(cap_url, body, new LLSetDisplayNameResponder); + LLHTTPClient::post(cap_url, body, new LLSetDisplayNameResponder, headers); } class LLSetDisplayNameReply : public LLHTTPNode -- cgit v1.2.3 From 17e2739a363447f5e12c9d84ab319f51e99e942a Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 6 May 2010 16:31:39 -0700 Subject: WIP Add default name expiration on set response, need headers later --- indra/newview/llviewerdisplayname.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'indra/newview/llviewerdisplayname.cpp') diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp index a6ac2587db..4122a112e5 100644 --- a/indra/newview/llviewerdisplayname.cpp +++ b/indra/newview/llviewerdisplayname.cpp @@ -148,6 +148,8 @@ public: } }; +#include "llsdserialize.h" + class LLDisplayNameUpdate : public LLHTTPNode { /*virtual*/ void post( @@ -164,6 +166,15 @@ class LLDisplayNameUpdate : public LLHTTPNode // Inject the new name data into cache LLAvatarName av_name; av_name.fromLLSD( name_data ); + + // Name expiration time may be provided in headers, or we may use a + // default value + // JAMESDEBUG TODO: get actual headers out of ResponsePtr + //LLSD headers = response->mHeaders; + LLSD headers; + av_name.mExpires = + LLAvatarNameCache::nameExpirationFromHeaders(headers); + LLAvatarNameCache::insert(agent_id, av_name); // force name tag to update -- cgit v1.2.3 From 5ad8364a68d64d2d921f4cf65dbab0eb7b03fc1d Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 7 May 2010 15:01:27 -0700 Subject: DEV-49780 Better confirmation/failure messages for setting name Reviewed with Callum --- indra/newview/llviewerdisplayname.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'indra/newview/llviewerdisplayname.cpp') diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp index 4122a112e5..bec2687cca 100644 --- a/indra/newview/llviewerdisplayname.cpp +++ b/indra/newview/llviewerdisplayname.cpp @@ -180,11 +180,16 @@ class LLDisplayNameUpdate : public LLHTTPNode // force name tag to update LLVOAvatar::invalidateNameTag(agent_id); - LLSD args; - args["OLD_NAME"] = old_display_name; - args["SLID"] = av_name.mSLID; - args["NEW_NAME"] = av_name.mDisplayName; - LLNotificationsUtil::add("DisplayNameUpdate", args); + // Don't show a notification for my name, because we'll show a nicer + // dialog + if (agent_id != gAgent.getID()) + { + LLSD args; + args["OLD_NAME"] = old_display_name; + args["SLID"] = av_name.mSLID; + args["NEW_NAME"] = av_name.mDisplayName; + LLNotificationsUtil::add("DisplayNameUpdate", args); + } } }; -- cgit v1.2.3 From ab79144d7937b12677d0a19145e3fc958e4c659c Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 12 May 2010 16:31:16 -0700 Subject: Remove unnecessary include (was for debugging) --- indra/newview/llviewerdisplayname.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llviewerdisplayname.cpp') diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp index bec2687cca..ec80129f8a 100644 --- a/indra/newview/llviewerdisplayname.cpp +++ b/indra/newview/llviewerdisplayname.cpp @@ -148,7 +148,6 @@ public: } }; -#include "llsdserialize.h" class LLDisplayNameUpdate : public LLHTTPNode { -- cgit v1.2.3 From f4148502e484d516b42c4a88603eee6889d45697 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 18 May 2010 16:00:45 -0700 Subject: Rename mSLID to mUsername to match the name of the field in the UI Product made a late-breaking request to change the name of this field. The wire protocol for People API has not yet changed. --- indra/newview/llviewerdisplayname.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewerdisplayname.cpp') diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp index ec80129f8a..a783cb03d8 100644 --- a/indra/newview/llviewerdisplayname.cpp +++ b/indra/newview/llviewerdisplayname.cpp @@ -185,7 +185,7 @@ class LLDisplayNameUpdate : public LLHTTPNode { LLSD args; args["OLD_NAME"] = old_display_name; - args["SLID"] = av_name.mSLID; + args["SLID"] = av_name.mUsername; args["NEW_NAME"] = av_name.mDisplayName; LLNotificationsUtil::add("DisplayNameUpdate", args); } -- cgit v1.2.3 From 892ac2bb1eec257bbf29d57738e819b7ff368bb9 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 28 May 2010 15:43:15 -0700 Subject: Added debugging code for names changes for when People API breaks --- indra/newview/llviewerdisplayname.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewerdisplayname.cpp') diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp index a783cb03d8..bda0fe9737 100644 --- a/indra/newview/llviewerdisplayname.cpp +++ b/indra/newview/llviewerdisplayname.cpp @@ -166,9 +166,13 @@ class LLDisplayNameUpdate : public LLHTTPNode LLAvatarName av_name; av_name.fromLLSD( name_data ); + llinfos << "name-update now " << LLDate::now() + << " next_update " << LLDate(av_name.mNextUpdate) + << llendl; + // Name expiration time may be provided in headers, or we may use a // default value - // JAMESDEBUG TODO: get actual headers out of ResponsePtr + // *TODO: get actual headers out of ResponsePtr //LLSD headers = response->mHeaders; LLSD headers; av_name.mExpires = -- cgit v1.2.3 From e45b3c6884bc7d9bc457b9633932c8aad5a28430 Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Sat, 4 Sep 2010 19:35:27 +0100 Subject: Correct license on newly exported files to LGPL. --- indra/newview/llviewerdisplayname.cpp | 37 +++++++++++++++-------------------- 1 file changed, 16 insertions(+), 21 deletions(-) (limited to 'indra/newview/llviewerdisplayname.cpp') diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp index bda0fe9737..09667928ab 100644 --- a/indra/newview/llviewerdisplayname.cpp +++ b/indra/newview/llviewerdisplayname.cpp @@ -2,33 +2,28 @@ * @file llviewerdisplayname.cpp * @brief Wrapper for display name functionality * - * $LicenseInfo:firstyear=2010&license=viewergpl$ - * - * Copyright (c) 2010, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2010&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * Copyright (C) 2010, Linden Research, Inc. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ + #include "llviewerprecompiledheaders.h" #include "llviewerdisplayname.h" -- cgit v1.2.3 From e27ac0abf7bef6e61c2d81911cc0c693206ee401 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Mon, 13 Sep 2010 16:20:52 -0700 Subject: As a resident I should also see the local chat message about me changing my display name so that my own chatlogs include my own changes. --- indra/newview/llviewerdisplayname.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'indra/newview/llviewerdisplayname.cpp') diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp index 09667928ab..f71a7c2d20 100644 --- a/indra/newview/llviewerdisplayname.cpp +++ b/indra/newview/llviewerdisplayname.cpp @@ -178,16 +178,11 @@ class LLDisplayNameUpdate : public LLHTTPNode // force name tag to update LLVOAvatar::invalidateNameTag(agent_id); - // Don't show a notification for my name, because we'll show a nicer - // dialog - if (agent_id != gAgent.getID()) - { - LLSD args; - args["OLD_NAME"] = old_display_name; - args["SLID"] = av_name.mUsername; - args["NEW_NAME"] = av_name.mDisplayName; - LLNotificationsUtil::add("DisplayNameUpdate", args); - } + LLSD args; + args["OLD_NAME"] = old_display_name; + args["SLID"] = av_name.mUsername; + args["NEW_NAME"] = av_name.mDisplayName; + LLNotificationsUtil::add("DisplayNameUpdate", args); } }; -- cgit v1.2.3 From 7ffc9b06c820d70724af2aef361ff9964e584e73 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Fri, 8 Oct 2010 16:56:02 -0700 Subject: Created a floater for setting display name --- indra/newview/llviewerdisplayname.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'indra/newview/llviewerdisplayname.cpp') diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp index f71a7c2d20..5741fab29a 100644 --- a/indra/newview/llviewerdisplayname.cpp +++ b/indra/newview/llviewerdisplayname.cpp @@ -44,6 +44,15 @@ namespace LLViewerDisplayName { // Fired when viewer receives server response to display name change set_name_signal_t sSetDisplayNameSignal; + + // Fired when there is a change in the agent's name + name_changed_signal_t sNameChangedSignal; + + void addNameChangedCallback(const name_changed_signal_t::slot_type& cb) + { + sNameChangedSignal.connect(cb); + } + } class LLSetDisplayNameResponder : public LLHTTPClient::Responder @@ -183,6 +192,10 @@ class LLDisplayNameUpdate : public LLHTTPNode args["SLID"] = av_name.mUsername; args["NEW_NAME"] = av_name.mDisplayName; LLNotificationsUtil::add("DisplayNameUpdate", args); + if (agent_id == gAgent.getID()) + { + LLViewerDisplayName::sNameChangedSignal(); + } } }; -- cgit v1.2.3