summaryrefslogtreecommitdiff
path: root/indra/newview/llavataractions.cpp
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2010-05-11 16:11:09 -0700
committerJames Cook <james@lindenlab.com>2010-05-11 16:11:09 -0700
commit2b7153c26a6dd5284218253910f466a0faeff708 (patch)
tree8b8f54545c540d4e5f28d4a91215280117f52dff /indra/newview/llavataractions.cpp
parentbae06b4b62587bd567495e3940a323e4c635a63e (diff)
parent8e1dbbbb5628eee210a0a7c25f32287d7b754a8b (diff)
merge from dessie/viewer-public right before SLE code landed
Diffstat (limited to 'indra/newview/llavataractions.cpp')
-rw-r--r--indra/newview/llavataractions.cpp54
1 files changed, 45 insertions, 9 deletions
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index f947300f54..85a087d6f6 100644
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -35,6 +35,8 @@
#include "llavataractions.h"
+#include "boost/lambda/lambda.hpp" // for lambda::constant
+
#include "llavatarnamecache.h" // IDEVO
#include "llsd.h"
#include "lldarray.h"
@@ -46,6 +48,7 @@
#include "llappviewer.h" // for gLastVersionChannel
#include "llcachename.h"
#include "llcallingcard.h" // for LLAvatarTracker
+#include "llfloateravatarpicker.h" // for LLFloaterAvatarPicker
#include "llfloatergroupinvite.h"
#include "llfloatergroups.h"
#include "llfloaterreg.h"
@@ -54,6 +57,7 @@
#include "llinventorymodel.h" // for gInventory.findCategoryUUIDForType
#include "llimview.h" // for gIMMgr
#include "llmutelist.h"
+#include "llnotificationsutil.h" // for LLNotificationsUtil
#include "llrecentpeople.h"
#include "llsidetray.h"
#include "lltrans.h"
@@ -114,13 +118,13 @@ void LLAvatarActions::removeFriendDialog(const LLUUID& id)
if (id.isNull())
return;
- std::vector<LLUUID> ids;
+ uuid_vec_t ids;
ids.push_back(id);
removeFriendsDialog(ids);
}
// static
-void LLAvatarActions::removeFriendsDialog(const std::vector<LLUUID>& ids)
+void LLAvatarActions::removeFriendsDialog(const uuid_vec_t& ids)
{
if(ids.size() == 0)
return;
@@ -144,7 +148,7 @@ void LLAvatarActions::removeFriendsDialog(const std::vector<LLUUID>& ids)
}
LLSD payload;
- for (std::vector<LLUUID>::const_iterator it = ids.begin(); it != ids.end(); ++it)
+ for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it)
{
payload["ids"].append(*it);
}
@@ -161,13 +165,21 @@ 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);
}
// static
-void LLAvatarActions::offerTeleport(const std::vector<LLUUID>& ids)
+void LLAvatarActions::offerTeleport(const uuid_vec_t& ids)
{
if (ids.size() == 0)
return;
@@ -243,7 +255,7 @@ void LLAvatarActions::startCall(const LLUUID& id)
}
// static
-void LLAvatarActions::startAdhocCall(const std::vector<LLUUID>& ids)
+void LLAvatarActions::startAdhocCall(const uuid_vec_t& ids)
{
if (ids.size() == 0)
{
@@ -252,7 +264,7 @@ void LLAvatarActions::startAdhocCall(const std::vector<LLUUID>& ids)
// convert vector into LLDynamicArray for addSession
LLDynamicArray<LLUUID> id_array;
- for (std::vector<LLUUID>::const_iterator it = ids.begin(); it != ids.end(); ++it)
+ for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it)
{
id_array.push_back(*it);
}
@@ -293,11 +305,11 @@ bool LLAvatarActions::canCall()
}
// static
-void LLAvatarActions::startConference(const std::vector<LLUUID>& ids)
+void LLAvatarActions::startConference(const uuid_vec_t& ids)
{
// *HACK: Copy into dynamic array
LLDynamicArray<LLUUID> id_array;
- for (std::vector<LLUUID>::const_iterator it = ids.begin(); it != ids.end(); ++it)
+ for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it)
{
id_array.push_back(*it);
}
@@ -432,6 +444,16 @@ void LLAvatarActions::share(const LLUUID& id)
}
}
+//static
+void LLAvatarActions::shareWithAvatars()
+{
+ LLFloaterAvatarPicker* picker =
+ LLFloaterAvatarPicker::show(NULL, FALSE, TRUE);
+ picker->setOkBtnEnableCb(boost::lambda::constant(false));
+
+ LLNotificationsUtil::add("ShareNotification");
+}
+
// static
void LLAvatarActions::toggleBlock(const LLUUID& id)
{
@@ -449,6 +471,20 @@ void LLAvatarActions::toggleBlock(const LLUUID& id)
LLMuteList::getInstance()->add(mute);
}
}
+// static
+bool LLAvatarActions::canOfferTeleport(const LLUUID& id)
+{
+ // First use LLAvatarTracker::isBuddy()
+ // If LLAvatarTracker::instance().isBuddyOnline function only is used
+ // then for avatars that are online and not a friend it will return false.
+ // But we should give an ability to offer a teleport for such avatars.
+ if(LLAvatarTracker::instance().isBuddy(id))
+ {
+ return LLAvatarTracker::instance().isBuddyOnline(id);
+ }
+
+ return true;
+}
void LLAvatarActions::inviteToGroup(const LLUUID& id)
{
@@ -514,7 +550,7 @@ bool LLAvatarActions::handlePay(const LLSD& notification, const LLSD& response,
// static
void LLAvatarActions::callback_invite_to_group(LLUUID group_id, LLUUID id)
{
- std::vector<LLUUID> agent_ids;
+ uuid_vec_t agent_ids;
agent_ids.push_back(id);
LLFloaterGroupInvite::showForGroup(group_id, &agent_ids);