diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 3456ba49cb..8b05acc318 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -440,15 +440,15 @@ void LLAvatarActions::showProfile(const LLUUID& id) if (id.notNull()) { // - if (gSavedSettings.getBOOL("FSUseWebProfiles")) +// LLAvatarNameCache::get(id, boost::bind(&on_avatar_name_show_profile, _1, _2)); + if (gSavedSettings.getBOOL("FSUseWebProfiles")) + { + showProfileWeb(id); + } + else { - showProfileWeb(id); - } - else - { showProfileLegacy(id); } -// LLAvatarNameCache::get(id, boost::bind(&on_avatar_name_show_profile, _1, _2)); // } } @@ -466,12 +466,11 @@ bool LLAvatarActions::profileVisible(const LLUUID& id) LLFloater* LLAvatarActions::getProfileFloater(const LLUUID& id) { // - if (!gSavedSettings.getBOOL("FSUseWebProfiles")) - { - FSFloaterProfile *browser = dynamic_cast - (LLFloaterReg::findInstance("floater_profile", LLSD().with("id", id))); - return browser; - } + if (!gSavedSettings.getBOOL("FSUseWebProfiles")) + { + FSFloaterProfile* browser = LLFloaterReg::findTypedInstance("floater_profile", LLSD().with("id", id)); + return browser; + } // LLFloaterWebContent *browser = dynamic_cast (LLFloaterReg::findInstance(get_profile_floater_name(id), LLSD().with("id", id))); @@ -493,7 +492,7 @@ void LLAvatarActions::showProfileLegacy(const LLUUID& id) { if (id.notNull()) { - LLFloaterReg::showInstance("floater_profile", LLSD().with("id", id)); + LLFloaterReg::showInstance("floater_profile", LLSD().with("id", id)); } } // @@ -758,49 +757,42 @@ namespace action_give_inventory * Checks My Inventory visibility. */ -// static bool is_give_inventory_acceptable() +// static bool is_give_inventory_acceptable() // [SL:KB] - Patch: Inventory-ShareSelection | Checked: 2011-06-29 (Catznip-2.6.0e) | Added: Catznip-2.6.0e - static bool is_give_inventory_acceptable(const uuid_set_t inventory_selected_uuids) + static bool is_give_inventory_acceptable(const uuid_set_t inventory_selected_uuids) // [/SL:KB] - { -// LLInventoryPanel* active_panel = get_active_inventory_panel(); -// if (!active_panel) return false; - -// // check selection in the panel + { +// // check selection in the panel // const std::set inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(); -// - if (inventory_selected_uuids.empty()) return false; // nothing selected + if (inventory_selected_uuids.empty()) return false; // nothing selected - bool acceptable = false; -// std::set::const_iterator it = inventory_selected_uuids.begin(); -// const std::set::const_iterator it_end = inventory_selected_uuids.end(); + bool acceptable = false; + std::set::const_iterator it = inventory_selected_uuids.begin(); + const std::set::const_iterator it_end = inventory_selected_uuids.end(); + for (; it != it_end; ++it) + { + LLViewerInventoryCategory* inv_cat = gInventory.getCategory(*it); + // any category can be offered. + if (inv_cat) + { + acceptable = true; + continue; + } - uuid_set_t::const_iterator it = inventory_selected_uuids.begin(); - const uuid_set_t::const_iterator it_end = inventory_selected_uuids.end(); - for (; it != it_end; ++it) - { - LLViewerInventoryCategory* inv_cat = gInventory.getCategory(*it); - // any category can be offered. - if (inv_cat) - { - acceptable = true; - continue; - } + LLViewerInventoryItem* inv_item = gInventory.getItem(*it); + // check if inventory item can be given + if (LLGiveInventory::isInventoryGiveAcceptable(inv_item)) + { + acceptable = true; + continue; + } - LLViewerInventoryItem* inv_item = gInventory.getItem(*it); - // check if inventory item can be given - if (LLGiveInventory::isInventoryGiveAcceptable(inv_item)) - { - acceptable = true; - continue; - } - - // there are neither item nor category in inventory - acceptable = false; - break; - } - return acceptable; - } + // there are neither item nor category in inventory + acceptable = false; + break; + } + return acceptable; + } static void build_items_string(const std::set& inventory_selected_uuids , std::string& items_string) diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp index fa0cb6bd9a..56a7938ab3 100755 --- a/indra/newview/llgroupactions.cpp +++ b/indra/newview/llgroupactions.cpp @@ -44,6 +44,7 @@ // Firestorm includes #include "exogroupmutelist.h" +#include "fscommon.h" #include "fsdata.h" #include "fsfloatercontacts.h" #include "fsfloatergroup.h" @@ -98,7 +99,7 @@ public: //LLSD params; //params["people_panel_tab_name"] = "groups_panel"; //LLFloaterSidePanelContainer::showPanel("people", "panel_people", params); - if (gSavedSettings.getBOOL("FSUseV2Friends") && gSavedSettings.getString("FSInternalSkinCurrent") != "Vintage") + if (gSavedSettings.getBOOL("FSUseV2Friends") && !FSCommon::isLegacySkin()) { LLSD params; params["people_panel_tab_name"] = "groups_panel"; @@ -612,15 +613,6 @@ LLUUID LLGroupActions::startIM(const LLUUID& group_id) { if (group_id.isNull()) return LLUUID::null; -// [RLVa:KB] - Checked: 2013-05-09 (RLVa-1.4.9) - if ( (!RlvActions::canStartIM(group_id)) && (!RlvActions::hasOpenGroupSession(group_id)) ) - { - make_ui_sound("UISndInvalidOp"); - RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_STARTIM, LLSD().with("RECIPIENT", LLSLURL("group", group_id, "about").getSLURLString())); - return LLUUID::null; - } -// [/RLVa:KB] - // [RLVa:KB] - Checked: 2013-05-09 (RLVa-1.4.9) if ( (!RlvActions::canStartIM(group_id)) && (!RlvActions::hasOpenGroupSession(group_id)) ) { @@ -661,13 +653,72 @@ LLUUID LLGroupActions::startIM(const LLUUID& group_id) } // [SL:KB] - Patch: Chat-GroupSnooze | Checked: 2012-06-17 (Catznip-3.3) +static void snooze_group_im(const LLUUID& group_id, S32 duration = -1) +{ + LLUUID session_id = gIMMgr->computeSessionID(IM_SESSION_GROUP_START, group_id); + if (session_id.notNull()) + { + LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(session_id); + + if (!session) + { + LL_WARNS() << "Empty session." << LL_ENDL; + return; + } + + session->mSnoozeTime = duration; + session->mCloseAction = LLIMModel::LLIMSession::CLOSE_SNOOZE; + + gIMMgr->leaveSession(session_id); + } +} + +static void snooze_group_im_duration_callback(const LLSD& notification, const LLSD& response, const LLUUID& group_id) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (0 == option) + { + std::istringstream duration_str(response["duration"].asString()); + S32 duration(-1); + if (duration_str >> duration && duration >= 0) + { + snooze_group_im(group_id, duration); + } + else + { + LLNotificationsUtil::add("SnoozeDurationInvalidInput"); + } + } +} + +static void confirm_group_im_snooze(const LLUUID& group_id) +{ + if (group_id.isNull()) + { + return; + } + + if (gSavedSettings.getBOOL("FSEnablePerGroupSnoozeDuration")) + { + LLSD args; + args["DURATION"] = gSavedSettings.getS32("GroupSnoozeTime"); + + LLNotificationsUtil::add("SnoozeDuration", args, LLSD(), boost::bind(&snooze_group_im_duration_callback, _1, _2, group_id)); + return; + } + + snooze_group_im(group_id); +} + static void close_group_im(const LLUUID& group_id, LLIMModel::LLIMSession::SCloseAction close_action) { if (group_id.isNull()) + { return; + } LLUUID session_id = gIMMgr->computeSessionID(IM_SESSION_GROUP_START, group_id); - if (session_id != LLUUID::null) + if (session_id.notNull()) { LLIMModel::LLIMSession* pIMSession = LLIMModel::getInstance()->findIMSession(session_id); if (pIMSession) @@ -685,7 +736,7 @@ void LLGroupActions::leaveIM(const LLUUID& group_id) void LLGroupActions::snoozeIM(const LLUUID& group_id) { - close_group_im(group_id, LLIMModel::LLIMSession::CLOSE_SNOOZE); + confirm_group_im_snooze(group_id); } void LLGroupActions::endIM(const LLUUID& group_id) @@ -779,13 +830,6 @@ bool LLGroupActions::canEjectFromGroup(const LLUUID& idGroup, const LLUUID& idAg void LLGroupActions::ejectFromGroup(const LLUUID& idGroup, const LLUUID& idAgent) { - // FIRE-8499 - Eject from group confirmation - //if (!canEjectFromGroup(idGroup, idAgent)) - // return; - - //uuid_vec_t idAgents; - //idAgents.push_back(idAgent); - //LLGroupMgr::instance().sendGroupMemberEjects(idGroup, idAgents); LLSD args; LLSD payload; payload["avatar_id"] = idAgent; @@ -818,7 +862,6 @@ bool LLGroupActions::callbackEject(const LLSD& notification, const LLSD& respons LLGroupMgr::instance().sendGroupMemberEjects(idGroup, idAgents); } return false; - // } // [/SL:KB] diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 1784577c8c..f0ce3d3585 100755 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -1305,8 +1305,8 @@ void LLNetMap::renderPropertyLinesForRegion(const LLViewerRegion* pRegion, const // // Render parcel lines // - static const F32 GRID_STEP = PARCEL_GRID_STEP_METERS; - static const S32 GRIDS_PER_EDGE = real_width / GRID_STEP; + const F32 GRID_STEP = PARCEL_GRID_STEP_METERS; + const S32 GRIDS_PER_EDGE = real_width / GRID_STEP; const U8* pOwnership = pRegion->getParcelOverlay()->getOwnership(); const U8* pCollision = (pRegion->getHandle() == LLViewerParcelMgr::instance().getCollisionRegionHandle()) ? LLViewerParcelMgr::instance().getCollisionBitmap() : NULL;