LLAvatarActions all hooked up!

Rlva style~ So update to RLVa stuff!
Adds support for @startim and @startimto
Enables hasOpenIM and hasOpenProfile, Yay functionality!
RLV_BHVR_STARTIM and RLV_BHVR_STARTIMTO added

While I was working, I was updating LLAgentHandler, after long enough it was identical enough to the one in llpanelprofile, so we're using that now.
Cleans up llfloateravatarinfo to the point of being a floater and instancetracker wrapper for a panelavatar (profile panel)
Bypasses looking up expired names that we know via get, this should avoid chats (and profiles, but that bug never got out) never opening for people we already know the name of on a bad connection; of course, this will only cause a faster reaction on the UI's part, messages may never get sent still (and profiles may never load) if the connection is truly terrible.
Cleans up llfloaterfriends and some parts of llfloateravatarlist (avatarlist could be cleaned up more from this perhaps in the future)
May slightly look better with copy detection and without space changes..

llgivemoney.cpp changes fix up some dummy view warnings I noticed while testing these changes
llpreview.cpp changes avoid segfault caused by llfloateravatarinfo not being a preview anymore but being inside a multipreview nonetheless.

Translators, don't worry, I covered this one with updates from v3 (Except German team)
This commit is contained in:
Lirusaito
2013-05-29 23:56:33 -04:00
parent 6ef3ba4e11
commit c701c61566
65 changed files with 1264 additions and 1330 deletions

View File

@@ -63,7 +63,6 @@
#include "llfirstuse.h"
#include "llfloaterabout.h"
#include "llfloateractivespeakers.h"
#include "llfloateravatarinfo.h"
#include "llfloateravatarlist.h"
#include "llfloateravatartextures.h"
#include "llfloaterbeacons.h"
@@ -79,12 +78,9 @@
#include "llfloaterdirectory.h"
#include "llfloatereditui.h"
#include "llfloaterchatterbox.h"
#include "llfloaterfriends.h"
#include "llfloaterfonttest.h"
#include "llfloatergesture.h"
#include "llfloatergodtools.h"
#include "llfloatergroupinvite.h"
#include "llfloatergroups.h"
#include "llfloaterhtmlcurrency.h"
#include "llfloatermediabrowser.h" // gViewerHtmlHelp
#include "llfloaterhud.h"
@@ -120,6 +116,7 @@
#include "llfloatermemleak.h"
#include "llframestats.h"
#include "llgivemoney.h"
#include "llavataractions.h"
#include "llgroupmgr.h"
#include "llhoverview.h"
#include "llhudeffecttrail.h"
@@ -3763,11 +3760,6 @@ bool LLHaveCallingcard::operator()(LLInventoryCategory* cat,
}
*/
BOOL is_agent_friend(const LLUUID& agent_id)
{
return (LLAvatarTracker::instance().getBuddyInfo(agent_id) != NULL);
}
BOOL is_agent_mappable(const LLUUID& agent_id)
{
const LLRelationship* buddy_info = LLAvatarTracker::instance().getBuddyInfo(agent_id);
@@ -3785,9 +3777,9 @@ class LLAvatarEnableAddFriend : public view_listener_t
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject());
// bool new_value = avatar && !is_agent_friend(avatar->getID());
// bool new_value = avatar && !LLAvatarActions::isFriend(avatar->getID());
// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f
bool new_value = avatar && !is_agent_friend(avatar->getID()) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
bool new_value = avatar && !LLAvatarActions::isFriend(avatar->getID()) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
// [/RLVa:KB]
gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
return true;
@@ -3809,7 +3801,7 @@ void request_friendship(const LLUUID& dest_id)
}
if (!full_name.empty())
{
LLPanelFriends::requestFriendshipDialog(dest_id, full_name);
LLAvatarActions::requestFriendshipDialog(dest_id, full_name);
}
else
{
@@ -6089,30 +6081,6 @@ void handle_look_at_selection(const LLSD& param)
}
}
void callback_invite_to_group(LLUUID group_id, void *user_data)
{
std::vector<LLUUID> agent_ids;
agent_ids.push_back(*(LLUUID *)user_data);
LLFloaterGroupInvite::showForGroup(group_id, &agent_ids);
}
void invite_to_group(const LLUUID& dest_id)
{
LLViewerObject* dest = gObjectList.findObject(dest_id);
if(dest && dest->isAvatar())
{
LLFloaterGroupPicker* widget;
widget = LLFloaterGroupPicker::showInstance(LLSD(gAgent.getID()));
if (widget)
{
widget->center();
widget->setPowersMask(GP_MEMBER_INVITE);
widget->setSelectCallback(callback_invite_to_group, (void *)&dest_id);
}
}
}
class LLAvatarInviteToGroup : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -6123,7 +6091,7 @@ class LLAvatarInviteToGroup : public view_listener_t
if ( (avatar) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) )
// [/RLVa:KB]
{
invite_to_group(avatar->getID());
LLAvatarActions::inviteToGroup(avatar->getID());
}
return true;
}
@@ -6134,9 +6102,9 @@ class LLAvatarAddFriend : public view_listener_t
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() );
// if(avatar && !is_agent_friend(avatar->getID()))
// if(avatar && !LLAvatarActions::isFriend(avatar->getID()))
// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f
if ( (avatar && !is_agent_friend(avatar->getID())) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) )
if ( (avatar && !LLAvatarActions::isFriend(avatar->getID())) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) )
// [/RLVa:KB]
{
request_friendship(avatar->getID());
@@ -6618,7 +6586,7 @@ class LLShowAgentProfile : public view_listener_t
if ( (avatar) && ((!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (gAgent.getID() == agent_id)) )
// [/RLVa:KB]
{
LLFloaterAvatarInfo::show(avatar->getID());
LLAvatarActions::showProfile(avatar->getID());
}
return true;
}
@@ -7269,28 +7237,12 @@ class LLAvatarSendIM : public view_listener_t
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() );
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | OK
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
{
return true;
}
// if(avatar)
// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.0d) | Added: RLVa-1.2.0d
if ((avatar) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)))
// [/RLVa:KB]
if(avatar)
{
std::string name("IM");
LLNameValue *first = avatar->getNVPair("FirstName");
LLNameValue *last = avatar->getNVPair("LastName");
if (first && last)
{
name.assign( first->getString() );
name.append(" ");
name.append( last->getString() );
}
gIMMgr->setFloaterOpen(TRUE);
//EInstantMessage type = have_agent_callingcard(gLastHitObjectID)
// ? IM_SESSION_ADD : IM_SESSION_CARDLESS_START;
gIMMgr->addSession(LLCacheName::cleanFullName(name),IM_NOTHING_SPECIAL,avatar->getID());
LLAvatarActions::startIM(avatar->getID());
}
return true;
}