summaryrefslogtreecommitdiff
path: root/indra/newview/llavataractions.cpp
diff options
context:
space:
mode:
authorRichard Nelson <none@none>2010-05-24 16:37:52 -0700
committerRichard Nelson <none@none>2010-05-24 16:37:52 -0700
commit2920d4c46f99c8c5bc8942a08a87fa204c57464b (patch)
tree515837435a28924b028815fc79f7f4f2ec18871e /indra/newview/llavataractions.cpp
parenta146a0f27b3ea2fadaa9e7286645a0944996309d (diff)
parentd674d11f895b8f3d578cded931cdc1c430379c95 (diff)
merge
Diffstat (limited to 'indra/newview/llavataractions.cpp')
-rw-r--r--indra/newview/llavataractions.cpp68
1 files changed, 37 insertions, 31 deletions
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 875ed72a12..6cef0b5119 100644
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -37,11 +37,11 @@
#include "boost/lambda/lambda.hpp" // for lambda::constant
+#include "llavatarnamecache.h" // IDEVO
#include "llsd.h"
#include "lldarray.h"
#include "llnotifications.h"
#include "llnotificationsutil.h"
-
#include "roles_constants.h" // for GP_MEMBER_INVITE
#include "llagent.h"
@@ -69,6 +69,7 @@
#include "llimfloater.h"
#include "lltrans.h"
#include "llcallingcard.h"
+#include "llslurl.h" // IDEVO
// static
void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::string& name)
@@ -80,7 +81,7 @@ void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::strin
}
LLSD args;
- args["NAME"] = name;
+ args["NAME"] = LLSLURL("agent", id, "inspect").getSLURLString();
LLSD payload;
payload["id"] = id;
payload["name"] = name;
@@ -135,11 +136,10 @@ void LLAvatarActions::removeFriendsDialog(const uuid_vec_t& ids)
if(ids.size() == 1)
{
LLUUID agent_id = ids[0];
- std::string first, last;
- if(gCacheName->getName(agent_id, first, last))
+ std::string full_name;
+ if(gCacheName->getFullName(agent_id, full_name))
{
- args["FIRST_NAME"] = first;
- args["LAST_NAME"] = last;
+ args["NAME"] = full_name;
}
msgType = "RemoveFromFriends";
@@ -189,20 +189,11 @@ void LLAvatarActions::offerTeleport(const uuid_vec_t& ids)
handle_lure(ids);
}
-// static
-void LLAvatarActions::startIM(const LLUUID& id)
+static void on_avatar_name_cache_start_im(const LLUUID& agent_id,
+ const LLAvatarName& av_name)
{
- if (id.isNull())
- return;
-
- std::string name;
- if (!gCacheName->getFullName(id, name))
- {
- gCacheName->get(id, FALSE, boost::bind(&LLAvatarActions::startIM, id));
- return;
- }
-
- LLUUID session_id = gIMMgr->addSession(name, IM_NOTHING_SPECIAL, id);
+ std::string name = av_name.getCompleteName();
+ LLUUID session_id = gIMMgr->addSession(name, IM_NOTHING_SPECIAL, agent_id);
if (session_id != LLUUID::null)
{
LLIMFloater::show(session_id);
@@ -211,6 +202,16 @@ void LLAvatarActions::startIM(const LLUUID& id)
}
// static
+void LLAvatarActions::startIM(const LLUUID& id)
+{
+ if (id.isNull())
+ return;
+
+ LLAvatarNameCache::get(id,
+ boost::bind(&on_avatar_name_cache_start_im, _1, _2));
+}
+
+// static
void LLAvatarActions::endIM(const LLUUID& id)
{
if (id.isNull())
@@ -223,6 +224,18 @@ void LLAvatarActions::endIM(const LLUUID& id)
}
}
+static void on_avatar_name_cache_start_call(const LLUUID& agent_id,
+ const LLAvatarName& av_name)
+{
+ std::string name = av_name.getCompleteName();
+ LLUUID session_id = gIMMgr->addSession(name, IM_NOTHING_SPECIAL, agent_id, true);
+ if (session_id != LLUUID::null)
+ {
+ gIMMgr->startCall(session_id);
+ }
+ make_ui_sound("UISndStartIM");
+}
+
// static
void LLAvatarActions::startCall(const LLUUID& id)
{
@@ -230,15 +243,8 @@ void LLAvatarActions::startCall(const LLUUID& id)
{
return;
}
-
- std::string name;
- gCacheName->getFullName(id, name);
- LLUUID session_id = gIMMgr->addSession(name, IM_NOTHING_SPECIAL, id, true);
- if (session_id != LLUUID::null)
- {
- gIMMgr->startCall(session_id);
- }
- make_ui_sound("UISndStartIM");
+ LLAvatarNameCache::get(id,
+ boost::bind(&on_avatar_name_cache_start_call, _1, _2));
}
// static
@@ -768,9 +774,9 @@ bool LLAvatarActions::isBlocked(const LLUUID& id)
// static
bool LLAvatarActions::canBlock(const LLUUID& id)
{
- std::string firstname, lastname;
- gCacheName->getName(id, firstname, lastname);
- bool is_linden = !LLStringUtil::compareStrings(lastname, "Linden");
+ std::string full_name;
+ gCacheName->getFullName(id, full_name);
+ bool is_linden = (full_name.find("Linden") != std::string::npos);
bool is_self = id == gAgentID;
return !is_self && !is_linden;
}