summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llavataractions.cpp71
-rw-r--r--indra/newview/llavataractions.h1
-rw-r--r--indra/newview/llcallingcard.cpp2
-rw-r--r--indra/newview/llchathistory.cpp10
-rw-r--r--indra/newview/llfloateravatarpicker.cpp18
-rw-r--r--indra/newview/llfloaterbuyland.cpp3
-rw-r--r--indra/newview/llfloaterland.cpp6
-rw-r--r--indra/newview/llfloaterregioninfo.cpp2
-rw-r--r--indra/newview/llfolderview.h2
-rw-r--r--indra/newview/llfoldervieweventlistener.h2
-rw-r--r--indra/newview/llfolderviewitem.h2
-rw-r--r--indra/newview/llhudnametag.cpp4
-rw-r--r--indra/newview/llinspectavatar.cpp2
-rw-r--r--indra/newview/lltoolpie.cpp2
-rw-r--r--indra/newview/llviewermessage.cpp19
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml14
16 files changed, 73 insertions, 87 deletions
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 6534f7921c..6699449625 100644
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -81,26 +81,22 @@ void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::strin
}
LLSD args;
- args["NAME"] = LLSLURL("agent", id, "inspect").getSLURLString();
+ args["NAME"] = LLSLURL("agent", id, "completename").getSLURLString();
LLSD payload;
payload["id"] = id;
payload["name"] = name;
- // Look for server versions like: Second Life Server 1.24.4.95600
- if (gLastVersionChannel.find(" 1.24.") != std::string::npos)
- {
- // Old and busted server version, doesn't support friend
- // requests with messages.
- LLNotificationsUtil::add("AddFriend", args, payload, &callbackAddFriend);
- }
- else
- {
- LLNotificationsUtil::add("AddFriendWithMessage", args, payload, &callbackAddFriendWithMessage);
- }
-
+
+ LLNotificationsUtil::add("AddFriendWithMessage", args, payload, &callbackAddFriendWithMessage);
+
// add friend to recent people list
LLRecentPeople::instance().add(id);
}
+void on_avatar_name_friendship(const LLUUID& id, const LLAvatarName av_name)
+{
+ LLAvatarActions::requestFriendshipDialog(id, av_name.getCompleteName());
+}
+
// static
void LLAvatarActions::requestFriendshipDialog(const LLUUID& id)
{
@@ -109,9 +105,7 @@ void LLAvatarActions::requestFriendshipDialog(const LLUUID& id)
return;
}
- std::string full_name;
- gCacheName->getFullName(id, full_name);
- requestFriendshipDialog(id, full_name);
+ LLAvatarNameCache::get(id, boost::bind(&on_avatar_name_friendship, _1, _2));
}
// static
@@ -136,10 +130,10 @@ void LLAvatarActions::removeFriendsDialog(const uuid_vec_t& ids)
if(ids.size() == 1)
{
LLUUID agent_id = ids[0];
- std::string full_name;
- if(gCacheName->getFullName(agent_id, full_name))
+ LLAvatarName av_name;
+ if(LLAvatarNameCache::get(agent_id, &av_name))
{
- args["NAME"] = full_name;
+ args["NAME"] = av_name.mDisplayName;
}
msgType = "RemoveFromFriends";
@@ -167,14 +161,6 @@ void LLAvatarActions::offerTeleport(const LLUUID& invitee)
if (invitee.isNull())
return;
- //waiting until Name Cache gets updated with corresponding avatar name
- std::string just_to_request_name;
- if (!gCacheName->getFullName(invitee, just_to_request_name))
- {
- gCacheName->get(invitee, FALSE, boost::bind((void (*)(const LLUUID&)) &LLAvatarActions::offerTeleport, invitee));
- return;
- }
-
LLDynamicArray<LLUUID> ids;
ids.push_back(invitee);
offerTeleport(ids);
@@ -340,14 +326,14 @@ void LLAvatarActions::showProfile(const LLUUID& id)
// static
void LLAvatarActions::showOnMap(const LLUUID& id)
{
- std::string name;
- if (!gCacheName->getFullName(id, name))
+ LLAvatarName av_name;
+ if (!LLAvatarNameCache::get(id, &av_name))
{
- gCacheName->get(id, FALSE, boost::bind(&LLAvatarActions::showOnMap, id));
+ LLAvatarNameCache::get(id, boost::bind(&LLAvatarActions::showOnMap, id));
return;
}
- gFloaterWorldMap->trackAvatar(id, name);
+ gFloaterWorldMap->trackAvatar(id, av_name.mDisplayName);
LLFloaterReg::showInstance("world_map");
}
@@ -544,7 +530,7 @@ void LLAvatarActions::toggleBlock(const LLUUID& id)
{
std::string name;
- gCacheName->getFullName(id, name);
+ gCacheName->getFullName(id, name); // needed for mute
LLMute mute(id, name, LLMute::AGENT);
if (LLMuteList::getInstance()->isMuted(mute.mID, mute.mName))
@@ -716,23 +702,6 @@ bool LLAvatarActions::handleUnfreeze(const LLSD& notification, const LLSD& respo
}
return false;
}
-// static
-bool LLAvatarActions::callbackAddFriend(const LLSD& notification, const LLSD& response)
-{
- S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
- if (option == 0)
- {
- // Servers older than 1.25 require the text of the message to be the
- // calling card folder ID for the offering user. JC
- LLUUID calling_card_folder_id =
- gInventory.findCategoryUUIDForType(LLFolderType::FT_CALLINGCARD);
- std::string message = calling_card_folder_id.asString();
- requestFriendship(notification["payload"]["id"].asUUID(),
- notification["payload"]["name"].asString(),
- message);
- }
- return false;
-}
// static
void LLAvatarActions::requestFriendship(const LLUUID& target_id, const std::string& target_name, const std::string& message)
@@ -765,7 +734,7 @@ bool LLAvatarActions::isFriend(const LLUUID& id)
bool LLAvatarActions::isBlocked(const LLUUID& id)
{
std::string name;
- gCacheName->getFullName(id, name);
+ gCacheName->getFullName(id, name); // needed for mute
return LLMuteList::getInstance()->isMuted(id, name);
}
@@ -773,7 +742,7 @@ bool LLAvatarActions::isBlocked(const LLUUID& id)
bool LLAvatarActions::canBlock(const LLUUID& id)
{
std::string full_name;
- gCacheName->getFullName(id, full_name);
+ gCacheName->getFullName(id, full_name); // needed for mute
bool is_linden = (full_name.find("Linden") != std::string::npos);
bool is_self = id == gAgentID;
return !is_self && !is_linden;
diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h
index d106a83eea..2d69c01ffe 100644
--- a/indra/newview/llavataractions.h
+++ b/indra/newview/llavataractions.h
@@ -184,7 +184,6 @@ public:
private:
- static bool callbackAddFriend(const LLSD& notification, const LLSD& response);
static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response);
static bool handleRemove(const LLSD& notification, const LLSD& response);
static bool handlePay(const LLSD& notification, const LLSD& response, LLUUID avatar_id);
diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp
index 7a1524b15e..9937364bc6 100644
--- a/indra/newview/llcallingcard.cpp
+++ b/indra/newview/llcallingcard.cpp
@@ -264,7 +264,7 @@ S32 LLAvatarTracker::addBuddyList(const LLAvatarTracker::buddy_map_t& buds)
{
++new_buddy_count;
mBuddyInfo[agent_id] = (*itr).second;
- // IDEVO JAMESDEBUG is this necessary? name is unused?
+ // IDEVO: is this necessary? name is unused?
gCacheName->getFullName(agent_id, full_name);
addChangedMask(LLFriendObserver::ADD, agent_id);
lldebugs << "Added buddy " << agent_id
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index 5323ecce72..c52e8daf43 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -274,10 +274,14 @@ public:
user_name->setValue(mFrom);
updateMinUserNameWidth();
}
- else if (mSourceType == CHAT_SOURCE_AGENT)
+ else if (mSourceType == CHAT_SOURCE_AGENT
+ && chat.mChatStyle != CHAT_STYLE_HISTORY)
{
- // ...from a normal user, lookup the name and fill in later,
- // but start with blank so sample data from XUI XML doesn't
+ // ...from a normal user, lookup the name and fill in later.
+ // *NOTE: Do not do this for chat history logs, otherwise the viewer
+ // will flood the People API with lookup requests on startup
+
+ // Start with blank so sample data from XUI XML doesn't
// flash on the screen
user_name->setValue( LLSD() );
LLAvatarNameCache::get(mAvatarID,
diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp
index d9c580320a..b533e394ff 100644
--- a/indra/newview/llfloateravatarpicker.cpp
+++ b/indra/newview/llfloateravatarpicker.cpp
@@ -177,7 +177,20 @@ static void getSelectedAvatarData(const LLScrollListCtrl* from, uuid_vec_t& avat
if (item->getUUID().notNull())
{
avatar_ids.push_back(item->getUUID());
- avatar_names.push_back(sAvatarNameMap[item->getUUID()]);
+
+ std::map<LLUUID, LLAvatarName>::iterator iter = sAvatarNameMap.find(item->getUUID());
+ if (iter != sAvatarNameMap.end())
+ {
+ avatar_names.push_back(iter->second);
+ }
+ else
+ {
+ // the only case where it isn't in the name map is friends
+ // but it should be in the name cache
+ LLAvatarName av_name;
+ LLAvatarNameCache::get(item->getUUID(), &av_name);
+ avatar_names.push_back(av_name);
+ }
}
}
}
@@ -280,6 +293,8 @@ void LLFloaterAvatarPicker::populateNearMe()
element["columns"][0]["value"] = av_name.mDisplayName;
element["columns"][1]["column"] = "username";
element["columns"][1]["value"] = av_name.mUsername;
+
+ sAvatarNameMap[av] = av_name;
}
near_me_scroller->addElement(element);
empty = FALSE;
@@ -314,7 +329,6 @@ void LLFloaterAvatarPicker::populateFriend()
LLAvatarTracker::instance().applyFunctor(collector);
LLCollectAllBuddies::buddy_map_t::iterator it;
-
for(it = collector.mOnline.begin(); it!=collector.mOnline.end(); it++)
{
friends_scroller->addStringUUIDItem(it->first, it->second);
diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp
index 292c88441a..2faa9531c4 100644
--- a/indra/newview/llfloaterbuyland.cpp
+++ b/indra/newview/llfloaterbuyland.cpp
@@ -829,8 +829,7 @@ void LLFloaterBuyLandUI::updateNames()
}
else
{
- mParcelSellerName =
- LLSLURL("agent", parcelp->getOwnerID(), "inspect").getSLURLString();
+ mParcelSellerName = LLSLURL("agent", parcelp->getOwnerID(), "completename").getSLURLString();
}
}
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index 167d4b09f7..2b24189813 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -1390,7 +1390,7 @@ bool LLPanelLandObjects::callbackReturnOwnerObjects(const LLSD& notification, co
}
else
{
- args["NAME"] = LLSLURL("agent", owner_id, "inspect").getSLURLString();
+ args["NAME"] = LLSLURL("agent", owner_id, "completename").getSLURLString();
LLNotificationsUtil::add("OtherObjectsReturned", args);
}
send_return_objects_message(parcel->getLocalID(), RT_OWNER);
@@ -1719,7 +1719,7 @@ void LLPanelLandObjects::onClickReturnOwnerObjects(void* userdata)
}
else
{
- args["NAME"] = LLSLURL("agent", owner_id, "inspect").getSLURLString();
+ args["NAME"] = LLSLURL("agent", owner_id, "completename").getSLURLString();
LLNotificationsUtil::add("ReturnObjectsOwnedByUser", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOwnerObjects, panelp, _1, _2));
}
}
@@ -1778,7 +1778,7 @@ void LLPanelLandObjects::onClickReturnOtherObjects(void* userdata)
}
else
{
- args["NAME"] = LLSLURL("agent", owner_id, "inspect").getSLURLString();
+ args["NAME"] = LLSLURL("agent", owner_id, "completename").getSLURLString();
LLNotificationsUtil::add("ReturnObjectsNotOwnedByUser", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOtherObjects, panelp, _1, _2));
}
}
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index df400b65d6..590e14a362 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -1538,7 +1538,7 @@ void LLPanelEstateInfo::onKickUserCommit(const uuid_vec_t& ids)
//Bring up a confirmation dialog
LLSD args;
- args["EVIL_USER"] = LLSLURL("agent", ids[0], "inspect").getSLURLString();
+ args["EVIL_USER"] = LLSLURL("agent", ids[0], "completename").getSLURLString();
LLSD payload;
payload["agent_id"] = ids[0];
LLNotificationsUtil::add("EstateKickUser", args, payload, boost::bind(&LLPanelEstateInfo::kickUserConfirm, this, _1, _2));
diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h
index 0dfdbd364b..8efd645521 100644
--- a/indra/newview/llfolderview.h
+++ b/indra/newview/llfolderview.h
@@ -120,7 +120,7 @@ public:
const std::string getFilterSubString(BOOL trim = FALSE);
U32 getFilterObjectTypes() const;
PermissionMask getFilterPermissions() const;
- // JAMESDEBUG use getFilter()->getShowFolderState();
+ // *NOTE: use getFilter()->getShowFolderState();
//LLInventoryFilter::EFolderShow getShowFolderState();
U32 getSortOrder() const;
BOOL isFilterModified();
diff --git a/indra/newview/llfoldervieweventlistener.h b/indra/newview/llfoldervieweventlistener.h
index a2ef8c1d12..0e2185bde5 100644
--- a/indra/newview/llfoldervieweventlistener.h
+++ b/indra/newview/llfoldervieweventlistener.h
@@ -31,7 +31,7 @@
#ifndef LLFOLDERVIEWEVENTLISTENER_H
#define LLFOLDERVIEWEVENTLISTENER_H
-#include "lldarray.h" // JAMESDEBUG convert to std::vector
+#include "lldarray.h" // *TODO: convert to std::vector
#include "llfoldertype.h"
#include "llfontgl.h" // just for StyleFlags enum
#include "llinventorytype.h"
diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h
index 57c722afa4..894b9df967 100644
--- a/indra/newview/llfolderviewitem.h
+++ b/indra/newview/llfolderviewitem.h
@@ -57,7 +57,7 @@ enum EInventorySortGroup
SG_ITEM
};
-// JAMESDEBUG *TODO: do we really need one sort object per folder?
+// *TODO: do we really need one sort object per folder?
// can we just have one of these per LLFolderView ?
class LLInventorySort
{
diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp
index 2cb333a717..303f048dfc 100644
--- a/indra/newview/llhudnametag.cpp
+++ b/indra/newview/llhudnametag.cpp
@@ -286,7 +286,7 @@ void LLHUDNameTag::renderText(BOOL for_select)
LLColor4 bg_color = LLUIColorTable::instance().getColor("NameTagBackground");
bg_color.setAlpha(gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor);
- // JAMESDEBUG - maybe a no-op
+ // maybe a no-op?
//const S32 border_height = 16;
//const S32 border_width = 16;
const S32 border_height = 8;
@@ -523,7 +523,7 @@ void LLHUDNameTag::renderText(BOOL for_select)
{
x_offset = -0.5f * mWidth + (HORIZONTAL_PADDING / 2.f);
- // JAMESDEBUG HACK
+ // *HACK
x_offset += 1;
}
diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp
index a9b9557027..1cd1dcc7f0 100644
--- a/indra/newview/llinspectavatar.cpp
+++ b/indra/newview/llinspectavatar.cpp
@@ -733,7 +733,7 @@ void LLInspectAvatar::onClickZoomIn()
void LLInspectAvatar::onClickFindOnMap()
{
- gFloaterWorldMap->trackAvatar(mAvatarID, mAvatarName.getLegacyName());
+ gFloaterWorldMap->trackAvatar(mAvatarID, mAvatarName.mDisplayName);
LLFloaterReg::showInstance("world_map");
}
diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp
index ebef28fd64..7dd68d392e 100644
--- a/indra/newview/lltoolpie.cpp
+++ b/indra/newview/lltoolpie.cpp
@@ -860,7 +860,7 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l
|| !existing_inspector->getVisible()
|| existing_inspector->getKey()["avatar_id"].asUUID() != hover_object->getID())
{
- // IDEVO JAMESDEBUG try to get display name + SLID
+ // IDEVO: try to get display name + username
std::string final_name;
std::string full_name;
if (!gCacheName->getFullName(hover_object->getID(), full_name))
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 704f4b4902..182b216cbb 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -2055,6 +2055,16 @@ static std::string clean_name_from_task_im(const std::string& msg,
return msg;
}
+void notification_display_name_callback(const LLUUID& id,
+ const LLAvatarName& av_name,
+ const std::string& name,
+ LLSD& substitutions,
+ const LLSD& payload)
+{
+ substitutions["NAME"] = av_name.mDisplayName;
+ LLNotificationsUtil::add(name, substitutions, payload);
+}
+
void process_improved_im(LLMessageSystem *msg, void **user_data)
{
if (gNoRender)
@@ -2817,7 +2827,12 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
args["NAME"] = name;
LLSD payload;
payload["from_id"] = from_id;
- LLNotificationsUtil::add("FriendshipAccepted", args, payload);
+ LLAvatarNameCache::get(from_id, boost::bind(&notification_display_name_callback,
+ _1,
+ _2,
+ "FriendshipAccepted",
+ args,
+ payload));
}
break;
@@ -2991,7 +3006,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
// IDEVO Correct for new-style "Resident" names
if (chat.mSourceType == CHAT_SOURCE_AGENT)
{
- // JAMESDEBUG - I don't know if it's OK to change this here, if
+ // I don't know if it's OK to change this here, if
// anything downstream does lookups by name, for instance
LLAvatarName av_name;
if (LLAvatarNameCache::useDisplayNames()
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index e1a6052efe..3f4cc10697 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -2009,20 +2009,6 @@ You do not have permission to buy land for your active group.
<notification
icon="alertmodal.tga"
label="Add Friend"
- name="AddFriend"
- type="alertmodal">
-Friends can give permissions to track each other on the map and receive online status updates.
-
-Offer friendship to [NAME]?
- <usetemplate
- name="okcancelbuttons"
- notext="Cancel"
- yestext="OK"/>
- </notification>
-
- <notification
- icon="alertmodal.tga"
- label="Add Friend"
name="AddFriendWithMessage"
type="alertmodal">
Friends can give permissions to track each other on the map and receive online status updates.