summaryrefslogtreecommitdiff
path: root/indra/newview/llagentlistener.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2011-05-20 11:41:28 -0400
committerLoren Shih <seraph@lindenlab.com>2011-05-20 11:41:28 -0400
commit781addcbc1c7611153ff58fd2f28062a1c4cd041 (patch)
treecebb3af3706fb6c9690562562201a468c56b97b4 /indra/newview/llagentlistener.cpp
parent19a06478d9863c451450b7c9e2f931ba587a3cec (diff)
parentce248b92d77e781d159f3838b5a2b5ef96360138 (diff)
Automated merge up from viewer-development into mesh-development
Diffstat (limited to 'indra/newview/llagentlistener.cpp')
-rw-r--r--indra/newview/llagentlistener.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/indra/newview/llagentlistener.cpp b/indra/newview/llagentlistener.cpp
index ed24febf41..9cea33c7c6 100644
--- a/indra/newview/llagentlistener.cpp
+++ b/indra/newview/llagentlistener.cpp
@@ -64,6 +64,12 @@ LLAgentListener::LLAgentListener(LLAgent &agent)
"[\"quat\"]: array of [x, y, z, w] quaternion values",
&LLAgentListener::getAxes,
LLSDMap("reply", LLSD()));
+ add("getGroups",
+ "Send on [\"reply\"], in [\"groups\"], an array describing agent's groups:\n"
+ "[\"id\"]: UUID of group\n"
+ "[\"name\"]: name of group",
+ &LLAgentListener::getGroups,
+ LLSDMap("reply", LLSD()));
}
void LLAgentListener::requestTeleport(LLSD const & event_data) const
@@ -140,3 +146,21 @@ void LLAgentListener::getAxes(const LLSD& event) const
("euler", LLSDMap("roll", roll)("pitch", pitch)("yaw", yaw)),
event);
}
+
+void LLAgentListener::getGroups(const LLSD& event) const
+{
+ LLSD reply(LLSD::emptyArray());
+ for (LLDynamicArray<LLGroupData>::const_iterator
+ gi(mAgent.mGroups.begin()), gend(mAgent.mGroups.end());
+ gi != gend; ++gi)
+ {
+ reply.append(LLSDMap
+ ("id", gi->mID)
+ ("name", gi->mName)
+ ("insignia", gi->mInsigniaID)
+ ("notices", bool(gi->mAcceptNotices))
+ ("display", bool(gi->mListInProfile))
+ ("contrib", gi->mContribution));
+ }
+ sendReply(LLSDMap("groups", reply), event);
+}