summaryrefslogtreecommitdiff
path: root/indra/newview/llagent.cpp
diff options
context:
space:
mode:
authorJon Wolk <jwolk@lindenlab.com>2007-12-19 00:56:59 +0000
committerJon Wolk <jwolk@lindenlab.com>2007-12-19 00:56:59 +0000
commit7dd08303a3ebf9718c2c60a4d94b81d5d7845f8c (patch)
tree6195a8585cc7998647afcaec2167e728e4abd3c1 /indra/newview/llagent.cpp
parent4d87303e78c1accde85b217b325e0c08930b0c4c (diff)
svn merge -r 75354:76103 svn+ssh://svn.lindenlab.com/svn/linden/branches/voice-group-moderation-3 -> release. Finished product of QAR-134
Diffstat (limited to 'indra/newview/llagent.cpp')
-rw-r--r--indra/newview/llagent.cpp102
1 files changed, 99 insertions, 3 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 5aaf9d0097..a692ef6a3e 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -2880,7 +2880,7 @@ void LLAgent::endAnimationUpdateUI()
mCameraLag.clearVec();
// JC - Added for always chat in third person option
- gFocusMgr.setKeyboardFocus(NULL, NULL);
+ gFocusMgr.setKeyboardFocus(NULL);
gToolMgr->setCurrentToolset(gMouselookToolset);
@@ -4004,7 +4004,7 @@ void LLAgent::changeCameraToMouselook(BOOL animate)
if( mCameraMode != CAMERA_MODE_MOUSELOOK )
{
- gViewerWindow->setKeyboardFocus( NULL, NULL );
+ gViewerWindow->setKeyboardFocus( NULL );
mLastCameraMode = mCameraMode;
mCameraMode = CAMERA_MODE_MOUSELOOK;
@@ -4225,7 +4225,7 @@ void LLAgent::changeCameraToCustomizeAvatar(BOOL animate)
mbFlagsDirty = TRUE;
}
- gViewerWindow->setKeyboardFocus( NULL, NULL );
+ gViewerWindow->setKeyboardFocus( NULL );
gViewerWindow->setMouseCapture( NULL );
LLVOAvatar::onCustomizeStart();
@@ -5225,6 +5225,102 @@ void LLAgent::processAgentDropGroup(LLMessageSystem *msg, void **)
}
}
+class LLAgentDropGroupViewerNode : public LLHTTPNode
+{
+ virtual void post(
+ LLHTTPNode::ResponsePtr response,
+ const LLSD& context,
+ const LLSD& input) const
+ {
+
+ if (
+ !input.isMap() ||
+ !input.has("body") )
+ {
+ //what to do with badly formed message?
+ response->status(400);
+ response->result(LLSD("Invalid message parameters"));
+ }
+
+ LLSD body = input["body"];
+ if ( body.has("body") )
+ {
+ //stupid message system doubles up the "body"s
+ body = body["body"];
+ }
+
+ if (
+ body.has("AgentData") &&
+ body["AgentData"].isArray() &&
+ body["AgentData"][0].isMap() )
+ {
+ llinfos << "VALID DROP GROUP" << llendl;
+
+ //there is only one set of data in the AgentData block
+ LLSD agent_data = body["AgentData"][0];
+ LLUUID agent_id;
+ LLUUID group_id;
+
+ agent_id = agent_data["AgentID"].asUUID();
+ group_id = agent_data["GroupID"].asUUID();
+
+ if (agent_id != gAgentID)
+ {
+ llwarns
+ << "AgentDropGroup for agent other than me" << llendl;
+
+ response->notFound();
+ return;
+ }
+
+ // Remove the group if it already exists remove it
+ // and add the new data to pick up changes.
+ LLGroupData gd;
+ gd.mID = group_id;
+ S32 index = gAgent.mGroups.find(gd);
+ if (index != -1)
+ {
+ gAgent.mGroups.remove(index);
+ if (gAgent.getGroupID() == group_id)
+ {
+ gAgent.mGroupID.setNull();
+ gAgent.mGroupPowers = 0;
+ gAgent.mGroupName[0] = '\0';
+ gAgent.mGroupTitle[0] = '\0';
+ }
+
+ // refresh all group information
+ gAgent.sendAgentDataUpdateRequest();
+
+ gGroupMgr->clearGroupData(group_id);
+ // close the floater for this group, if any.
+ LLFloaterGroupInfo::closeGroup(group_id);
+ // refresh the group panel of the search window,
+ //if necessary.
+ LLFloaterDirectory::refreshGroup(group_id);
+ }
+ else
+ {
+ llwarns
+ << "AgentDropGroup, agent is not part of group "
+ << group_id << llendl;
+ }
+
+ response->result(LLSD());
+ }
+ else
+ {
+ //what to do with badly formed message?
+ response->status(400);
+ response->result(LLSD("Invalid message parameters"));
+ }
+ }
+};
+
+LLHTTPRegistration<LLAgentDropGroupViewerNode>
+ gHTTPRegistrationAgentDropGroupViewerNode(
+ "/message/AgentDropGroup");
+
// static
void LLAgent::processAgentGroupDataUpdate(LLMessageSystem *msg, void **)
{