diff options
Diffstat (limited to 'indra/newview/llpanelgrouproles.cpp')
| -rw-r--r-- | indra/newview/llpanelgrouproles.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index b4adbe0819..5c8c5c85b2 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -53,6 +53,7 @@ #include "llviewerwindow.h" #include "llfocusmgr.h" #include "llviewercontrol.h" +#include "llviewerregion.h" #include "roles_constants.h" @@ -541,6 +542,19 @@ bool LLPanelGroupSubTab::matchesActionSearchFilter(std::string action) } } +// Powers the viewer knows about but the current region has not enabled +// via SimulatorFeatures; these are hidden from the abilities lists. +static U64 get_unsupported_powers() +{ + U64 unsupported = 0; + LLViewerRegion* region = gAgent.getRegion(); + if (!region || !region->groupChatPostLinksEnabled()) + { + unsupported |= GP_SESSION_POST_LINKS; + } + return unsupported; +} + void LLPanelGroupSubTab::buildActionsList(LLScrollListCtrl* ctrl, U64 allowed_by_some, U64 allowed_by_all, @@ -582,8 +596,9 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl, bool is_owner_role) { LL_DEBUGS() << "Building role list for: " << action_set->mActionSetData->mName << LL_ENDL; + U64 unsupported_powers = get_unsupported_powers(); // See if the allow mask matches anything in this category. - if (show_all || (allowed_by_some & action_set->mActionSetData->mPowerBit)) + if (show_all || (allowed_by_some & action_set->mActionSetData->mPowerBit & ~unsupported_powers)) { // List all the actions in this category that at least some members have. LLSD row; @@ -619,6 +634,12 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl, for ( ; ra_it != ra_end; ++ra_it) { + // Skip abilities the current region doesn't support. + if (unsupported_powers & (*ra_it)->mPowerBit) + { + continue; + } + // See if anyone has these action. if (!show_all && !(allowed_by_some & (*ra_it)->mPowerBit)) { |
