Initial moap commit. /VERY/ WIP. Primarily committed to clean up unstaged changes. Do not run this, even if it may compile, as it will NOT work (for a myriad of reasons)!

This commit is contained in:
Shyotl
2013-05-31 05:33:41 -05:00
parent 641ada030e
commit ef3e918558
148 changed files with 15636 additions and 4633 deletions

View File

@@ -42,10 +42,13 @@
#include "llfloatergroupinfo.h"
#include "llfloatermute.h"
#include "llmutelist.h"
#include "llsdutil.h"
#include "llslurl.h"
#include "lltrans.h"
#include "llui.h"
#include "lluictrl.h"
#include "lluictrlfactory.h"
#include "llurldispatcher.h"
#include "llviewercontrol.h"
#include "llurlaction.h"
#include "llweb.h"
// [RLVa:KB] - Version: 1.23.4
#include "rlvhandler.h"
@@ -61,7 +64,7 @@ public:
BOOL postBuild(void);
void update(const LLUUID& id, const std::string& name, const std::string& slurl, const LLUUID& owner, bool owner_is_group);
void update(LLSD& payload);
// UI Handlers
static void onClickMap(void* data);
@@ -72,15 +75,14 @@ public:
private:
LLUUID mObjectID;
std::string mObjectName;
std::string mSlurl;
LLUUID mOwnerID;
std::string mOwnerName;
bool mOwnerIsGroup;
std::string mSLurl;
std::string mName;
bool mGroupOwned;
};
LLFloaterObjectIMInfo::LLFloaterObjectIMInfo(const LLSD& seed)
: mObjectID(), mObjectName(), mSlurl(), mOwnerID(), mOwnerName(), mOwnerIsGroup(false)
: mObjectID(), mName(), mSLurl(), mOwnerID(), mGroupOwned(false)
{
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_object_im_info.xml");
@@ -100,34 +102,37 @@ BOOL LLFloaterObjectIMInfo::postBuild(void)
return true;
}
void LLFloaterObjectIMInfo::update(const LLUUID& object_id, const std::string& name, const std::string& slurl, const LLUUID& owner_id, bool owner_is_group)
void LLFloaterObjectIMInfo::update(LLSD& data)
{
// Extract appropriate object information from input LLSD
// (Eventually, it might be nice to query server for details
// rather than require caller to pass in the information.)
mObjectID = data["object_id"].asUUID();
mName = data["name"].asString();
mOwnerID = data["owner_id"].asUUID();
mGroupOwned = data["group_owned"].asBoolean();
mSLurl = data["slurl"].asString();
// When talking to an old region we won't have a slurl.
// The object id isn't really the object id either but we don't use it so who cares.
//bool have_slurl = !slurl.empty();
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-04 (RLVa-1.0.0a) | Added: RLVa-0.2.0g
bool have_slurl = (!slurl.empty()) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC));
bool have_slurl = (!mSLurl.empty()) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC));
// [/RLVa:KB]
childSetVisible("Unknown_Slurl",!have_slurl);
childSetVisible("Slurl",have_slurl);
childSetText("ObjectName",name);
childSetText("Slurl",slurl);
childSetText("ObjectName",mName);
childSetText("Slurl",mSLurl);
childSetText("OwnerName",std::string(""));
// bool my_object = (owner_id == gAgentID);
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0g
bool my_object = (owner_id == gAgentID) || ((gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(owner_id)));
bool my_object = (mOwnerID == gAgentID) || ((gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(mOwnerID)));
// [/RLVa:KB]
childSetEnabled("Mute",!my_object);
mObjectID = object_id;
mObjectName = name;
mSlurl = slurl;
mOwnerID = owner_id;
mOwnerIsGroup = owner_is_group;
if (gCacheName) gCacheName->get(owner_id,owner_is_group,boost::bind(&LLFloaterObjectIMInfo::nameCallback,this,_1,_2,_3));
if (gCacheName) gCacheName->get(mOwnerID,mGroupOwned,boost::bind(&LLFloaterObjectIMInfo::nameCallback,this,_1,_2,_3));
}
//static
@@ -135,17 +140,15 @@ void LLFloaterObjectIMInfo::onClickMap(void* data)
{
LLFloaterObjectIMInfo* self = (LLFloaterObjectIMInfo*)data;
std::ostringstream link;
link << "secondlife://" << self->mSlurl;
class LLMediaCtrl* web = NULL;
LLURLDispatcher::dispatch(link.str(), web, true);
std::string url = "secondlife://" + self->mSLurl;
LLUrlAction::showLocationOnMap(url);
}
//static
void LLFloaterObjectIMInfo::onClickOwner(void* data)
{
LLFloaterObjectIMInfo* self = (LLFloaterObjectIMInfo*)data;
if (self->mOwnerIsGroup)
if (self->mGroupOwned)
{
LLFloaterGroupInfo::showFromUUID(self->mOwnerID);
}
@@ -163,7 +166,7 @@ void LLFloaterObjectIMInfo::onClickMute(void* data)
{
LLFloaterObjectIMInfo* self = (LLFloaterObjectIMInfo*)data;
LLMute::EType mute_type = (self->mOwnerIsGroup) ? LLMute::GROUP : LLMute::AGENT;
LLMute::EType mute_type = (self->mGroupOwned) ? LLMute::GROUP : LLMute::AGENT;
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0g
if ( (LLMute::GROUP != mute_type) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(self->mOwnerID)) )
{
@@ -171,7 +174,7 @@ void LLFloaterObjectIMInfo::onClickMute(void* data)
}
// [/RLVa:KB]
LLMute mute(self->mOwnerID, self->mOwnerName, mute_type);
LLMute mute(self->mOwnerID, self->mName, mute_type);
LLMuteList::getInstance()->add(mute);
LLFloaterMute::showInstance();
self->close();
@@ -180,49 +183,50 @@ void LLFloaterObjectIMInfo::onClickMute(void* data)
//static
void LLFloaterObjectIMInfo::nameCallback(const LLUUID& id, const std::string& full_name, bool is_group)
{
mOwnerName = full_name;
mName = full_name;
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0g
if ( (!is_group) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(id)) )
{
mOwnerName = RlvStrings::getAnonym(mOwnerName);
mName = RlvStrings::getAnonym(mName);
}
// [/RLVa:KB]
childSetText("OwnerName", mOwnerName);
}
////////////////////////////////////////////////////////////////////////////
// LLObjectIMInfo
void LLObjectIMInfo::show(const LLUUID &object_id, const std::string &name, const std::string &location, const LLUUID &owner_id, bool owner_is_group)
{
LLFloaterObjectIMInfo* im_info_floater = LLFloaterObjectIMInfo::showInstance();
im_info_floater->update(object_id,name,location,owner_id,owner_is_group);
childSetText("OwnerName", mName);
}
////////////////////////////////////////////////////////////////////////////
// LLObjectIMInfoHandler
//moved to llchathistory.cpp in v2
class LLObjectIMInfoHandler : public LLCommandHandler
{
public:
LLObjectIMInfoHandler() : LLCommandHandler("objectim", true) { }
LLObjectIMInfoHandler() : LLCommandHandler("objectim", UNTRUSTED_THROTTLE) { }
bool handle(const LLSD& tokens, const LLSD& query_map,
LLMediaCtrl* web);
bool handle(const LLSD& params, const LLSD& query_map,LLMediaCtrl* web)
{
if (params.size() < 1)
{
return false;
}
LLUUID object_id;
if (!object_id.set(params[0], FALSE))
{
return false;
}
LLSD payload;
payload["object_id"] = object_id;
payload["owner_id"] = query_map["owner"];
payload["name"] = query_map["name"];
payload["slurl"] = LLWeb::escapeURL(query_map["slurl"]);
payload["group_owned"] = query_map["groupowned"];
LLFloaterObjectIMInfo::showInstance()->update(payload);
return true;
}
};
// Creating the object registers with the dispatcher.
LLObjectIMInfoHandler gObjectIMHandler;
// ex. secondlife:///app/objectim/9426adfc-9c17-8765-5f09-fdf19957d003?owner=a112d245-9095-4e9c-ace4-ffa31717f934&groupowned=true&slurl=ahern/123/123/123&name=Object
bool LLObjectIMInfoHandler::handle(const LLSD &tokens, const LLSD &query_map, LLMediaCtrl* web)
{
LLUUID task_id = tokens[0].asUUID();
std::string name = query_map["name"].asString();
std::string slurl = query_map["slurl"].asString();
LLUUID owner = query_map["owner"].asUUID();
bool group_owned = query_map.has("groupowned");
LLObjectIMInfo::show(task_id,name,slurl,owner,group_owned);
return true;
}