Skip to content
Snippets Groups Projects
Commit a04eb169 authored by Alexei Arabadji's avatar Alexei Arabadji
Browse files

fixed EXT-2740 "There is no alert on giving/removing modify rights to

resident"

--HG--
branch : product-engine
parent 00fe55c9
Branches
No related tags found
No related merge requests found
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
#include "llweb.h" #include "llweb.h"
#include "llfloaterworldmap.h" #include "llfloaterworldmap.h"
#include "llfloaterreg.h" #include "llfloaterreg.h"
#include "llnotifications.h"
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLDropTarget // Class LLDropTarget
...@@ -199,6 +200,46 @@ void LLPanelAvatarNotes::onCommitNotes() ...@@ -199,6 +200,46 @@ void LLPanelAvatarNotes::onCommitNotes()
LLAvatarPropertiesProcessor::getInstance()-> sendNotes(getAvatarId(),notes); LLAvatarPropertiesProcessor::getInstance()-> sendNotes(getAvatarId(),notes);
} }
void LLPanelAvatarNotes::rightsConfirmationCallback(const LLSD& notification,
const LLSD& response, S32 rights)
{
S32 option = LLNotification::getSelectedOption(notification, response);
if (option == 0)
{
LLAvatarPropertiesProcessor::getInstance()->sendFriendRights(
getAvatarId(), rights);
}
else
{
childSetValue("objects_check",
childGetValue("objects_check").asBoolean() ? FALSE : TRUE);
}
}
void LLPanelAvatarNotes::confirmModifyRights(bool grant, S32 rights)
{
std::string first, last;
LLSD args;
if (gCacheName->getName(getAvatarId(), first, last))
{
args["FIRST_NAME"] = first;
args["LAST_NAME"] = last;
}
if (grant)
{
LLNotifications::instance().add("GrantModifyRights", args, LLSD(),
boost::bind(&LLPanelAvatarNotes::rightsConfirmationCallback, this,
_1, _2, rights));
}
else
{
LLNotifications::instance().add("RevokeModifyRights", args, LLSD(),
boost::bind(&LLPanelAvatarNotes::rightsConfirmationCallback, this,
_1, _2, rights));
}
}
void LLPanelAvatarNotes::onCommitRights() void LLPanelAvatarNotes::onCommitRights()
{ {
S32 rights = 0; S32 rights = 0;
...@@ -210,7 +251,14 @@ void LLPanelAvatarNotes::onCommitRights() ...@@ -210,7 +251,14 @@ void LLPanelAvatarNotes::onCommitRights()
if(childGetValue("objects_check").asBoolean()) if(childGetValue("objects_check").asBoolean())
rights |= LLRelationship::GRANT_MODIFY_OBJECTS; rights |= LLRelationship::GRANT_MODIFY_OBJECTS;
LLAvatarPropertiesProcessor::getInstance()->sendFriendRights(getAvatarId(),rights); const LLRelationship* buddy_relationship =
LLAvatarTracker::instance().getBuddyInfo(getAvatarId());
bool allow_modify_objects = childGetValue("objects_check").asBoolean();
if (buddy_relationship->isRightGrantedTo(
LLRelationship::GRANT_MODIFY_OBJECTS) != allow_modify_objects)
{
confirmModifyRights(allow_modify_objects, rights);
}
} }
void LLPanelAvatarNotes::processProperties(void* data, EAvatarProcessorType type) void LLPanelAvatarNotes::processProperties(void* data, EAvatarProcessorType type)
......
...@@ -260,6 +260,9 @@ class LLPanelAvatarNotes ...@@ -260,6 +260,9 @@ class LLPanelAvatarNotes
*/ */
void fillRightsData(); void fillRightsData();
void rightsConfirmationCallback(const LLSD& notification,
const LLSD& response, S32 rights);
void confirmModifyRights(bool grant, S32 rights);
void onCommitRights(); void onCommitRights();
void onCommitNotes(); void onCommitNotes();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment