diff --git a/FIRESTORM-FEATURETABLE.txt b/FIRESTORM-FEATURETABLE.txt index ce8e6f3c93..6e53c77b07 100644 --- a/FIRESTORM-FEATURETABLE.txt +++ b/FIRESTORM-FEATURETABLE.txt @@ -23,3 +23,4 @@ MapTeleportAbove255m LGPL NonBusyAutoresponse LGPL V1_Clienttags LGPL AlwaysShowFriendPerms LGPL +GlobalFriendVisToggle LGPL diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index a44f678b14..0bd938a21a 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1,6 +1,17 @@ + GlobalOnlineStatusToggle + + Comment + Saves the state of global online status permission for friends + Persist + 1 + Type + Boolean + Value + 1 + RenderVolumeSAThreshold Comment diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 7dcf7c2367..135b54dec9 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -33,6 +33,17 @@ Value The Resident you messaged is in 'unavailable mode' which means they have requested not to be disturbed. Your message will still be shown in their IM panel for later viewing. + GlobalOnlineStatusToggle + + Comment + Saves the state of global online status permission for friends + Persist + 1 + Type + Boolean + Value + 1 + InstantMessageLogPath Comment diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 37197ca179..de11f4633a 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -160,7 +160,7 @@ void LLAvatarListItem::onMouseEnter(S32 x, S32 y, MASK mask) mHovered = true; LLPanel::onMouseEnter(x, y, mask); - showPermissions(mShowPermissions); + showPermissions(true); updateChildren(); } @@ -186,7 +186,8 @@ void LLAvatarListItem::changed(U32 mask) if ((mask & LLFriendObserver::POWERS) || (mask & LLFriendObserver::PERMS)) { //showPermissions(mShowPermissions && mHovered); AO- Keep icons around persistently. - showPermissions(mShowPermissions); + llinfos << "Permissions changed, updating Children." << llendl; + showPermissions(true); updateChildren(); } } @@ -643,15 +644,23 @@ bool LLAvatarListItem::showPermissions(bool visible) if (!relation->isRightGrantedTo(LLRelationship::GRANT_ONLINE_STATUS)) mIconPermissionOnline->setColor(LLUIColorTable::instance().getColor("Transparent")); + else + mIconPermissionOnline->setColor(LLUIColorTable::instance().getColor("White")); if (!relation->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION)) mIconPermissionMap->setColor(LLUIColorTable::instance().getColor("Transparent")); - + else + mIconPermissionMap->setColor(LLUIColorTable::instance().getColor("White")); + if (!relation->isRightGrantedTo(LLRelationship::GRANT_MODIFY_OBJECTS)) mIconPermissionEditMine->setColor(LLUIColorTable::instance().getColor("Transparent")); + else + mIconPermissionEditMine->setColor(LLUIColorTable::instance().getColor("White")); if (!relation->isRightGrantedFrom(LLRelationship::GRANT_MODIFY_OBJECTS)) mIconPermissionEditTheirs->setColor(LLUIColorTable::instance().getColor("Transparent")); + else + mIconPermissionEditTheirs->setColor(LLUIColorTable::instance().getColor("White")); } else diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 4a410cb5bb..11fabffafe 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -39,6 +39,7 @@ #include "llpanelpeople.h" // newview +#include "llavatarpropertiesprocessor.h" #include "llaccordionctrl.h" #include "llaccordionctrltab.h" #include "llagent.h" @@ -568,6 +569,7 @@ BOOL LLPanelPeople::postBuild() LLPanel* friends_panel = getChild(FRIENDS_TAB_NAME); friends_panel->childSetAction("add_btn", boost::bind(&LLPanelPeople::onAddFriendWizButtonClicked, this)); friends_panel->childSetAction("del_btn", boost::bind(&LLPanelPeople::onDeleteFriendButtonClicked, this)); + friends_panel->childSetAction("GlobalOnlineStatusToggle", boost::bind(&LLPanelPeople::onGlobalVisToggleButtonClicked, this)); mOnlineFriendList->setItemDoubleClickCallback(boost::bind(&LLPanelPeople::onAvatarListDoubleClicked, this, _1)); mAllFriendList->setItemDoubleClickCallback(boost::bind(&LLPanelPeople::onAvatarListDoubleClicked, this, _1)); @@ -1119,6 +1121,47 @@ void LLPanelPeople::onAddFriendWizButtonClicked() } } +void LLPanelPeople::onGlobalVisToggleButtonClicked() +// Iterate through friends lists, toggling status permission on or off +{ + llinfos << "TOGGLE GLOBAL FRIEND VIS" << llendl; + bool vis = getChild("GlobalOnlineStatusToggle")->getValue().asBoolean(); + gSavedSettings.setBOOL("GlobalOnlineStatusToggle", vis); + + const LLAvatarTracker& av_tracker = LLAvatarTracker::instance(); + LLAvatarTracker::buddy_map_t all_buddies; + av_tracker.copyBuddyList(all_buddies); + LLAvatarTracker::buddy_map_t::const_iterator buddy_it = all_buddies.begin(); + for (; buddy_it != all_buddies.end(); ++buddy_it) + { + LLUUID buddy_id = buddy_it->first; + const LLRelationship* relation = LLAvatarTracker::instance().getBuddyInfo(buddy_id); + if (relation == NULL) + { + // Lets have a warning log message instead of having a crash. EXT-4947. + llwarns << "Trying to modify rights for non-friend avatar. Skipped." << llendl; + return; + } + + S32 cur_rights = relation->getRightsGrantedTo(); + S32 new_rights = 0; + if (vis) + new_rights = LLRelationship::GRANT_ONLINE_STATUS + (cur_rights & LLRelationship::GRANT_MAP_LOCATION) + (cur_rights & LLRelationship::GRANT_MODIFY_OBJECTS); + else + new_rights = (cur_rights & LLRelationship::GRANT_MAP_LOCATION) + (cur_rights & LLRelationship::GRANT_MODIFY_OBJECTS); + + llinfos << "TOGGLING " << buddy_id << " " << vis << llendl; + LLAvatarPropertiesProcessor::getInstance()->sendFriendRights(buddy_id,new_rights); + + + } + + mAllFriendList->showPermissions(true); + mOnlineFriendList->showPermissions(true); + updateFriendList(); + //LLAvatarListItem::changed(LLFriendObserver::POWERS); +} + void LLPanelPeople::onDeleteFriendButtonClicked() { uuid_vec_t selected_uuids; diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 53cbfe1a72..ea49270f9b 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -95,6 +95,7 @@ private: void onViewProfileButtonClicked(); void onAddFriendButtonClicked(); void onAddFriendWizButtonClicked(); + void onGlobalVisToggleButtonClicked(); void onDeleteFriendButtonClicked(); void onGroupInfoButtonClicked(); void onChatButtonClicked(); diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index 96a69c4a99..dc2663edd2 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -267,7 +267,7 @@ Looking for people to hang out with? Use the search box to find topics or conten height="25" layout="topleft" name="add_btn_panel" - width="32"> + width="64">