Ejemplo n.º 1
0
        /// <summary>
        ///   Approve a post.
        /// </summary>
        /// <remarks>
        ///   <para>
        ///     Like clicking the "approve" button on the modqueue page.
        ///   </para>
        /// </remarks>
        public string ApprovePost(Data.OneItemData post)
        {
            var m = MsgForPost(post);

            FireProgress(Stage.Before, Activity.ApproveItem, m);

            // this.lblStatus.Text = "approving " + post.title;
            // this.Update();

            EnforceDelay();
            string addr     = redditBaseAddr + "/api/approve.json";
            string postData = String.Format("id={0}&uh={1}&r={2}",
                                            post.name,
                                            modHash,
                                            post.subreddit);
            var r = DoPostAction(addr, postData);

            FireProgress(Stage.After, Activity.ApproveItem, m);
            post.handled = true;
            return(r);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///   Remove a post.
        /// </summary>
        /// <remarks>
        ///   <para>
        ///     Like clicking the "remove" button on the modqueue page.
        ///   </para>
        /// </remarks>
        public string RemovePost(Data.OneItemData post, bool notSpam = false)
        {
            var m = MsgForPost(post);

            FireProgress(Stage.Before, Activity.RemoveItem, m);

            EnforceDelay();
            string addr     = redditBaseAddr + "/api/remove.json";
            string postData = String.Format("id={0}&uh={1}&r={2}",
                                            post.name,
                                            modHash,
                                            post.subreddit);

            if (notSpam)
            {
                postData += "&spam=false";
            }

            var r = DoPostAction(addr, postData);

            FireProgress(Stage.After, Activity.RemoveItem, m);
            post.handled = true;
            return(r);
        }