byte[] HandleGetNotices(Dictionary <string, object> request)
        {
            Dictionary <string, object> result = new Dictionary <string, object>();

            if (!request.ContainsKey("RequestingAgentID"))
            {
                NullResult(result, "Bad network data");
            }

            else if (request.ContainsKey("NoticeID")) // just one
            {
                GroupNoticeInfo notice = m_GroupsService.GetGroupNotice(request["RequestingAgentID"].ToString(), new UUID(request["NoticeID"].ToString()));

                if (notice == null)
                {
                    NullResult(result, "NO such notice");
                }
                else
                {
                    result["RESULT"] = GroupsDataUtils.GroupNoticeInfo(notice);
                }
            }
            else if (request.ContainsKey("GroupID")) // all notices for group
            {
                List <ExtendedGroupNoticeData> notices = m_GroupsService.GetGroupNotices(request["RequestingAgentID"].ToString(), new UUID(request["GroupID"].ToString()));

                if (notices == null || (notices != null && notices.Count == 0))
                {
                    NullResult(result, "No notices");
                }
                else
                {
                    Dictionary <string, object> dict = new Dictionary <string, object>();
                    int i = 0;
                    foreach (ExtendedGroupNoticeData n in notices)
                    {
                        dict["n-" + i++] = GroupsDataUtils.GroupNoticeData(n);
                    }

                    result["RESULT"] = dict;
                }
            }
            else
            {
                NullResult(result, "Bad OP in request");
            }

            string xmlString = ServerUtils.BuildXmlResponse(result);

            return(Util.UTF8NoBomEncoding.GetBytes(xmlString));
        }
        public GroupNoticeInfo GetGroupNotice(string RequestingAgentID, UUID noticeID)
        {
            GroupNoticeInfo notice = m_GroupsService.GetGroupNotice(RequestingAgentID, noticeID);

            //if (notice != null && notice.noticeData.HasAttachment && notice.noticeData.AttachmentOwnerID != null)
            //{
            //    UUID userID = UUID.Zero;
            //    string url = string.Empty, first = string.Empty, last = string.Empty, tmp = string.Empty;
            //    Util.ParseUniversalUserIdentifier(notice.noticeData.AttachmentOwnerID, out userID, out url, out first, out last, out tmp);
            //    if (url != string.Empty)
            //        m_UserManagement.AddUser(userID, first, last, url);
            //}

            return(notice);
        }