summaryrefslogtreecommitdiff
path: root/indra/newview/llagent.cpp
diff options
context:
space:
mode:
authorSam Kolb <skolb@lindenlab.com>2007-08-30 22:11:52 +0000
committerSam Kolb <skolb@lindenlab.com>2007-08-30 22:11:52 +0000
commitb2595c369f78b6613e329274f5ca7c43c4ddeda0 (patch)
tree4db6ae8237692b570b6e5dad489f3da24c5aa3fe /indra/newview/llagent.cpp
parent84ea29c69c320573c7547f028b5325382e195cc6 (diff)
Merge sl-search-opt-in back into the release branch
Reviewed by Josh and Don
Diffstat (limited to 'indra/newview/llagent.cpp')
-rw-r--r--indra/newview/llagent.cpp71
1 files changed, 69 insertions, 2 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index e12904ef43..3000cce4f9 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -28,6 +28,7 @@
#include "llquaternion.h"
#include "v3math.h"
#include "v4math.h"
+#include "llsdutil.h"
//#include "vmath.h"
#include "imageids.h"
@@ -4808,7 +4809,7 @@ BOOL LLAgent::setGroupContribution(const LLUUID& group_id, S32 contribution)
return FALSE;
}
-BOOL LLAgent::setGroupAcceptNotices(const LLUUID& group_id, BOOL accept_notices)
+BOOL LLAgent::setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOOL list_in_profile)
{
S32 count = mGroups.count();
for(S32 i = 0; i < count; ++i)
@@ -4816,6 +4817,7 @@ BOOL LLAgent::setGroupAcceptNotices(const LLUUID& group_id, BOOL accept_notices)
if(mGroups.get(i).mID == group_id)
{
mGroups.get(i).mAcceptNotices = accept_notices;
+ mGroups.get(i).mListInProfile = list_in_profile;
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("SetGroupAcceptNotices");
msg->nextBlock("AgentData");
@@ -4824,6 +4826,8 @@ BOOL LLAgent::setGroupAcceptNotices(const LLUUID& group_id, BOOL accept_notices)
msg->nextBlock("Data");
msg->addUUID("GroupID", group_id);
msg->addBOOL("AcceptNotices", accept_notices);
+ msg->nextBlock("NewData");
+ msg->addBOOL("ListInProfile", list_in_profile);
sendReliableMessage();
return TRUE;
}
@@ -5177,6 +5181,70 @@ void LLAgent::processAgentGroupDataUpdate(LLMessageSystem *msg, void **)
}
+class LLAgentGroupDataUpdateViewerNode : public LLHTTPNode
+{
+ virtual void post(
+ LLHTTPNode::ResponsePtr response,
+ const LLSD& context,
+ const LLSD& input) const
+ {
+ LLSD body = input["body"];
+ if(body.has("body"))
+ body = body["body"];
+ LLUUID agent_id = body["AgentData"][0]["AgentID"].asUUID();
+
+ if (agent_id != gAgentID)
+ {
+ llwarns << "processAgentGroupDataUpdate for agent other than me" << llendl;
+ return;
+ }
+
+ LLSD group_data = body["GroupData"];
+
+ LLSD::array_iterator iter_group =
+ group_data.beginArray();
+ LLSD::array_iterator end_group =
+ group_data.endArray();
+ int group_index = 0;
+ for(; iter_group != end_group; ++iter_group)
+ {
+
+ LLGroupData group;
+ S32 index = -1;
+ bool need_floater_update = false;
+
+ group.mID = (*iter_group)["GroupID"].asUUID();
+ group.mPowers = ll_U64_from_sd((*iter_group)["GroupPowers"]);
+ group.mAcceptNotices = (*iter_group)["AcceptNotices"].asBoolean();
+ group.mListInProfile = body["NewGroupData"][group_index]["ListInProfile"].asBoolean();
+ group.mInsigniaID = (*iter_group)["GroupInsigniaID"].asUUID();
+ group.mName = (*iter_group)["GroupName"].asString();
+ group.mContribution = (*iter_group)["Contribution"].asInteger();
+
+ group_index++;
+
+ if(group.mID.notNull())
+ {
+ need_floater_update = true;
+ // Remove the group if it already exists remove it and add the new data to pick up changes.
+ index = gAgent.mGroups.find(group);
+ if (index != -1)
+ {
+ gAgent.mGroups.remove(index);
+ }
+ gAgent.mGroups.put(group);
+ }
+ if (need_floater_update)
+ {
+ update_group_floaters(group.mID);
+ }
+ }
+ }
+};
+
+LLHTTPRegistration<LLAgentGroupDataUpdateViewerNode >
+ gHTTPRegistrationAgentGroupDataUpdateViewerNode ("/message/AgentGroupDataUpdate");
+
// static
void LLAgent::processAgentDataUpdate(LLMessageSystem *msg, void **)
{
@@ -7269,5 +7337,4 @@ void LLAgent::parseTeleportMessages(const LLString& xml_filename)
}//end for (all message sets in xml file)
}
-
// EOF