public List <ExtendedGroupNoticeData> GetGroupNotices(string RequestingAgentID, UUID GroupID)
        {
            List <ExtendedGroupNoticeData> notices = new List <ExtendedGroupNoticeData>();

            Dictionary <string, object> sendData = new Dictionary <string, object>();

            sendData["GroupID"]           = GroupID.ToString();
            sendData["RequestingAgentID"] = RequestingAgentID;
            Dictionary <string, object> ret = MakeRequest("GETNOTICES", sendData);

            if (ret == null)
            {
                return(notices);
            }

            if (!ret.ContainsKey("RESULT"))
            {
                return(notices);
            }

            if (ret["RESULT"].ToString() == "NULL")
            {
                return(notices);
            }

            foreach (object v in ((Dictionary <string, object>)ret["RESULT"]).Values)
            {
                ExtendedGroupNoticeData m = GroupsDataUtils.GroupNoticeData((Dictionary <string, object>)v);
                notices.Add(m);
            }

            return(notices);
        }
        public static Dictionary <string, object> GroupNoticeData(ExtendedGroupNoticeData notice)
        {
            Dictionary <string, object> dict = new Dictionary <string, object>();

            dict["NoticeID"]          = notice.NoticeID.ToString();
            dict["Timestamp"]         = notice.Timestamp.ToString();
            dict["FromName"]          = Sanitize(notice.FromName);
            dict["Subject"]           = Sanitize(notice.Subject);
            dict["HasAttachment"]     = notice.HasAttachment.ToString();
            dict["AttachmentItemID"]  = notice.AttachmentItemID.ToString();
            dict["AttachmentName"]    = Sanitize(notice.AttachmentName);
            dict["AttachmentType"]    = notice.AttachmentType.ToString();
            dict["AttachmentOwnerID"] = Sanitize(notice.AttachmentOwnerID);

            return(dict);
        }
        public List <ExtendedGroupNoticeData> GetGroupNotices(string RequestingAgentID, UUID groupID)
        {
            NoticeData[] data = m_Database.RetrieveNotices(groupID);
            List <ExtendedGroupNoticeData> infos = new List <ExtendedGroupNoticeData>();

            if (data == null || (data != null && data.Length == 0))
            {
                return(infos);
            }

            foreach (NoticeData d in data)
            {
                ExtendedGroupNoticeData info = _NoticeDataToData(d);
                infos.Add(info);
            }

            return(infos);
        }
Exemple #4
0
        private ExtendedGroupNoticeData _NoticeDataToData(NoticeData data)
        {
            ExtendedGroupNoticeData notice = new ExtendedGroupNoticeData();

            notice.FromName      = data.Data["FromName"];
            notice.NoticeID      = data.NoticeID;
            notice.Subject       = data.Data["Subject"];
            notice.Timestamp     = uint.Parse((string)data.Data["TMStamp"]);
            notice.HasAttachment = data.Data["HasAttachment"] == "1" ? true : false;
            if (notice.HasAttachment)
            {
                notice.AttachmentName    = data.Data["AttachmentName"];
                notice.AttachmentItemID  = new UUID(data.Data["AttachmentItemID"].ToString());
                notice.AttachmentType    = byte.Parse(data.Data["AttachmentType"].ToString());
                notice.AttachmentOwnerID = data.Data["AttachmentOwnerID"].ToString();
            }

            return(notice);
        }
        public static ExtendedGroupNoticeData GroupNoticeData(Dictionary <string, object> dict)
        {
            ExtendedGroupNoticeData notice = new ExtendedGroupNoticeData();

            if (dict == null)
            {
                return(notice);
            }

            notice.NoticeID          = new UUID(dict["NoticeID"].ToString());
            notice.Timestamp         = UInt32.Parse(dict["Timestamp"].ToString());
            notice.FromName          = Sanitize(dict["FromName"].ToString());
            notice.Subject           = Sanitize(dict["Subject"].ToString());
            notice.HasAttachment     = bool.Parse(dict["HasAttachment"].ToString());
            notice.AttachmentItemID  = new UUID(dict["AttachmentItemID"].ToString());
            notice.AttachmentName    = dict["AttachmentName"].ToString();
            notice.AttachmentType    = byte.Parse(dict["AttachmentType"].ToString());
            notice.AttachmentOwnerID = dict["AttachmentOwnerID"].ToString();

            return(notice);
        }
        public static ExtendedGroupNoticeData GroupNoticeData(Dictionary<string, object> dict)
        {
            ExtendedGroupNoticeData notice = new ExtendedGroupNoticeData();

            if (dict == null)
                return notice;

            notice.NoticeID = new UUID(dict["NoticeID"].ToString());
            notice.Timestamp = UInt32.Parse(dict["Timestamp"].ToString());
            notice.FromName = Sanitize(dict["FromName"].ToString());
            notice.Subject = Sanitize(dict["Subject"].ToString());
            notice.HasAttachment = bool.Parse(dict["HasAttachment"].ToString());
            notice.AttachmentItemID = new UUID(dict["AttachmentItemID"].ToString());
            notice.AttachmentName = dict["AttachmentName"].ToString();
            notice.AttachmentType = byte.Parse(dict["AttachmentType"].ToString());
            notice.AttachmentOwnerID = dict["AttachmentOwnerID"].ToString();

            return notice;
        }
        public static Dictionary<string, object> GroupNoticeData(ExtendedGroupNoticeData notice)
        {
            Dictionary<string, object> dict = new Dictionary<string, object>();

            dict["NoticeID"] = notice.NoticeID.ToString();
            dict["Timestamp"] = notice.Timestamp.ToString();
            dict["FromName"] = Sanitize(notice.FromName);
            dict["Subject"] = Sanitize(notice.Subject);
            dict["HasAttachment"] = notice.HasAttachment.ToString();
            dict["AttachmentItemID"] = notice.AttachmentItemID.ToString();
            dict["AttachmentName"] = Sanitize(notice.AttachmentName);
            dict["AttachmentType"] = notice.AttachmentType.ToString();
            dict["AttachmentOwnerID"] = Sanitize(notice.AttachmentOwnerID);

            return dict;
        }
Exemple #8
0
        ExtendedGroupNoticeData _NoticeDataToData(NoticeData data)
        {
            ExtendedGroupNoticeData notice = new ExtendedGroupNoticeData();
            notice.FromName = data.Data["FromName"];
            notice.NoticeID = data.NoticeID;
            notice.Subject = data.Data["Subject"];
            notice.Timestamp = uint.Parse((string)data.Data["TMStamp"]);
            notice.HasAttachment = data.Data["HasAttachment"] == "1" ? true : false;
            if (notice.HasAttachment)
            {
                notice.AttachmentName = data.Data["AttachmentName"];
                notice.AttachmentItemID = new UUID(data.Data["AttachmentItemID"].ToString());
                notice.AttachmentType = byte.Parse(data.Data["AttachmentType"].ToString());
                notice.AttachmentOwnerID = data.Data["AttachmentOwnerID"].ToString();
            }


            return notice;
        }