diff --git a/indra/newview/llfloaterobjectiminfo.cpp b/indra/newview/llfloaterobjectiminfo.cpp index 5d433bca6..ce65e8d8c 100644 --- a/indra/newview/llfloaterobjectiminfo.cpp +++ b/indra/newview/llfloaterobjectiminfo.cpp @@ -58,32 +58,37 @@ // LLFloaterObjectIMInfo LLFloaterObjectIMInfo::LLFloaterObjectIMInfo(const LLSD& seed) -: mObjectID(), mName(), mSLurl(), mOwnerID(), mGroupOwned(false) +: mName(), mSLurl(), mOwnerID(), mGroupOwned(false) { LLUICtrlFactory::getInstance()->buildFloater(this, "floater_object_im_info.xml"); - if (getRect().mLeft == 0 - && getRect().mBottom == 0) - { + if (!getRect().mLeft && !getRect().mBottom) center(); - } } -BOOL LLFloaterObjectIMInfo::postBuild(void) +static void show_avatar_profile(const LLUUID& id) { - childSetAction("Mute",onClickMute,this); - childSetActionTextbox("OwnerName",onClickOwner, this); - childSetActionTextbox("Slurl",onClickMap, this); +// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0g + if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) || !RlvUtil::isNearbyAgent(id)) + return; +// [/RLVa:KB] + LLAvatarActions::showProfile(id); +} + +BOOL LLFloaterObjectIMInfo::postBuild() +{ + getChild("Mute")->setCommitCallback(boost::bind(&LLFloaterObjectIMInfo::onClickMute, this)); + getChild("OwnerName")->setClickedCallback(boost::bind(boost::ref(mGroupOwned) ? boost::bind(LLGroupActions::show, boost::ref(mOwnerID)) : boost::bind(show_avatar_profile, boost::ref(mOwnerID)))); + getChild("Slurl")->setClickedCallback(boost::bind(LLUrlAction::showLocationOnMap, "secondlife://" + static_cast(boost::ref(mSLurl)))); return true; } -void LLFloaterObjectIMInfo::update(LLSD& data) +void LLFloaterObjectIMInfo::update(const 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(); @@ -100,7 +105,8 @@ void LLFloaterObjectIMInfo::update(LLSD& data) childSetText("ObjectName",mName); childSetText("Slurl",mSLurl); - childSetText("OwnerName",std::string("")); + childSetText("OwnerName", LLStringUtil::null); + getChildView("ObjectID")->setValue(data["object_id"].asUUID()); // 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 @@ -108,77 +114,43 @@ void LLFloaterObjectIMInfo::update(LLSD& data) // [/RLVa:KB] childSetEnabled("Mute",!my_object); - if (gCacheName) gCacheName->get(mOwnerID,mGroupOwned,boost::bind(&LLFloaterObjectIMInfo::nameCallback,this,_1,_2,_3)); + if (gCacheName) + gCacheName->get(mOwnerID, mGroupOwned, boost::bind(&LLFloaterObjectIMInfo::nameCallback, this, _2)); } -//static -void LLFloaterObjectIMInfo::onClickMap(void* data) +void LLFloaterObjectIMInfo::onClickMute() { - LLFloaterObjectIMInfo* self = (LLFloaterObjectIMInfo*)data; - - std::string url = "secondlife://" + self->mSLurl; - LLUrlAction::showLocationOnMap(url); -} - -//static -void LLFloaterObjectIMInfo::onClickOwner(void* data) -{ - LLFloaterObjectIMInfo* self = (LLFloaterObjectIMInfo*)data; - if (self->mGroupOwned) - { - LLGroupActions::show(self->mOwnerID); - } -// else // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0g - else if ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (!RlvUtil::isNearbyAgent(self->mOwnerID)) ) -// [/RLVa:KB] - { - LLAvatarActions::showProfile(self->mOwnerID); - } -} - -//static -void LLFloaterObjectIMInfo::onClickMute(void* data) -{ - LLFloaterObjectIMInfo* self = (LLFloaterObjectIMInfo*)data; - - 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)) ) - { + if (!mGroupOwned && gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) && RlvUtil::isNearbyAgent(mOwnerID)) return; - } // [/RLVa:KB] - LLMute mute(self->mOwnerID, self->mName, mute_type); - LLMuteList::getInstance()->add(mute); + LLMuteList::instance().add(LLMute(mOwnerID, mName, mGroupOwned ? LLMute::GROUP : LLMute::AGENT)); LLFloaterMute::showInstance(); - self->close(); + close(); } //static -void LLFloaterObjectIMInfo::nameCallback(const LLUUID& id, const std::string& full_name, bool is_group) +void LLFloaterObjectIMInfo::nameCallback(const std::string& full_name) { - mName = full_name; + childSetText("OwnerName", mName = // [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)) ) - { - mName = RlvStrings::getAnonym(mName); - } + (!mGroupOwned && gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) && RlvUtil::isNearbyAgent(mOwnerID)) ? RlvStrings::getAnonym(mName) : // [/RLVa:KB] - - childSetText("OwnerName", mName); + full_name); } //////////////////////////////////////////////////////////////////////////// -// LLObjectIMInfoHandler +// LLObjectIMHandler //moved to llchathistory.cpp in v2 -class LLObjectIMInfoHandler : public LLCommandHandler +// support for secondlife:///app/objectim/{UUID}/ SLapps +class LLObjectIMHandler : public LLCommandHandler { public: - LLObjectIMInfoHandler() : LLCommandHandler("objectim", UNTRUSTED_THROTTLE) { } + // requests will be throttled from a non-trusted browser + LLObjectIMHandler() : LLCommandHandler("objectim", UNTRUSTED_THROTTLE) { } - bool handle(const LLSD& params, const LLSD& query_map,LLMediaCtrl* web) + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) { if (params.size() < 1) { @@ -197,12 +169,8 @@ public: 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; +LLObjectIMHandler gObjectIMHandler; diff --git a/indra/newview/llfloaterobjectiminfo.h b/indra/newview/llfloaterobjectiminfo.h index 58377c009..31ff8c162 100644 --- a/indra/newview/llfloaterobjectiminfo.h +++ b/indra/newview/llfloaterobjectiminfo.h @@ -41,19 +41,16 @@ public: LLFloaterObjectIMInfo(const LLSD& sd); virtual ~LLFloaterObjectIMInfo() { }; - /*virtual*/ BOOL postBuild(void); + /*virtual*/ BOOL postBuild(); - void update(LLSD& payload); + void update(const LLSD& payload); // UI Handlers - static void onClickMap(void* data); - static void onClickOwner(void* data); - static void onClickMute(void* data); + void onClickMute(); - void nameCallback(const LLUUID& id, const std::string& full_name, bool is_group); + void nameCallback(const std::string& full_name); private: - LLUUID mObjectID; LLUUID mOwnerID; std::string mSLurl; std::string mName; diff --git a/indra/newview/skins/default/xui/en-us/floater_object_im_info.xml b/indra/newview/skins/default/xui/en-us/floater_object_im_info.xml index 6bbd39e89..318f614e4 100644 --- a/indra/newview/skins/default/xui/en-us/floater_object_im_info.xml +++ b/indra/newview/skins/default/xui/en-us/floater_object_im_info.xml @@ -5,7 +5,7 @@ rect_control="FloaterObjectIMInfo" short_title="Object Info" title="Object Information" > Object: @@ -17,7 +17,7 @@ width="200" /> Location: @@ -37,7 +37,7 @@ Owner: @@ -47,8 +47,12 @@ font="SansSerif" height="20" is_unicode="false" left="70" hover="true" max_length="254" mouse_opaque="true" name="OwnerName" font-style="UNDERLINE" width="200" hover_cursor="UI_CURSOR_HAND" text_color="TextLinkColor" hover_color="TextLinkHoverColor"/> - -