summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorYuri Chebotarev <ychebotarev@productengine.com>2009-11-27 13:36:06 +0200
committerYuri Chebotarev <ychebotarev@productengine.com>2009-11-27 13:36:06 +0200
commit51a7388d683e89e9ee5ef06fd16a5bc02f5c7d94 (patch)
treef3b278249e017db67ed54918e92d8be7175b4042 /indra
parent0a6570fe10993cde205b97a09c582efa584262fc (diff)
parenta04eb16976baef0d4cb75658d8a25b21c4eec840 (diff)
merge
--HG-- branch : product-engine
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llpanelavatar.cpp50
-rw-r--r--indra/newview/llpanelavatar.h3
2 files changed, 52 insertions, 1 deletions
diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp
index 87f1ac1f9f..4c26440bda 100644
--- a/indra/newview/llpanelavatar.cpp
+++ b/indra/newview/llpanelavatar.cpp
@@ -50,6 +50,7 @@
#include "llweb.h"
#include "llfloaterworldmap.h"
#include "llfloaterreg.h"
+#include "llnotifications.h"
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLDropTarget
@@ -199,6 +200,46 @@ void LLPanelAvatarNotes::onCommitNotes()
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()
{
S32 rights = 0;
@@ -210,7 +251,14 @@ void LLPanelAvatarNotes::onCommitRights()
if(childGetValue("objects_check").asBoolean())
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)
diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h
index dc94ff02ca..f54aeee4eb 100644
--- a/indra/newview/llpanelavatar.h
+++ b/indra/newview/llpanelavatar.h
@@ -260,6 +260,9 @@ protected:
*/
void fillRightsData();
+ void rightsConfirmationCallback(const LLSD& notification,
+ const LLSD& response, S32 rights);
+ void confirmModifyRights(bool grant, S32 rights);
void onCommitRights();
void onCommitNotes();