diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llagentlistener.cpp | 24 | ||||
-rw-r--r-- | indra/newview/llagentlistener.h | 1 |
2 files changed, 25 insertions, 0 deletions
diff --git a/indra/newview/llagentlistener.cpp b/indra/newview/llagentlistener.cpp index c453fe91f4..d6de25e42e 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); +} diff --git a/indra/newview/llagentlistener.h b/indra/newview/llagentlistener.h index 0aa58d0b16..5a89a99f6a 100644 --- a/indra/newview/llagentlistener.h +++ b/indra/newview/llagentlistener.h @@ -46,6 +46,7 @@ private: void requestStand(LLSD const & event_data) const; void resetAxes(const LLSD& event) const; void getAxes(const LLSD& event) const; + void getGroups(const LLSD& event) const; private: LLAgent & mAgent; |