summaryrefslogtreecommitdiff
path: root/indra/newview/llavataractions.cpp
diff options
context:
space:
mode:
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 e6666c7f83..764d54a987 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 "llsd.h"
#include "lldarray.h"
#include "llnotifications.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"
@@ -113,13 +117,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;
@@ -228,7 +240,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)
{
@@ -237,7 +249,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);
}
@@ -278,11 +290,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);
}
@@ -417,6 +429,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)
{
@@ -434,6 +456,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)
{
@@ -499,7 +535,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);