Esempio n. 1
0
        public override IHttpRequestBuilder CreateHttpRequestBuilder()
        {
            HttpPostRequestBuilder builder = new HttpPostRequestBuilder("newreply.php");
            builder.AddParameter("action", ACTION);
            builder.AddParameter("threadid", threadid);
            builder.AddParameter("formkey", formKey);
            builder.AddParameter("form_cookie", formCookie);
            builder.AddParameter("message", Message);

            if (BookmarkThread)
                builder.AddParameter("bookmark", "yes");

            if (ParseUrls)
                builder.AddParameter("parseurl", "yes");

            builder.AddParameter("submit", SUBMIT);
            return builder;
        }
        public System.Net.Http.IHttpRequestBuilder CreateHttpRequestBuilder()
        {
            IPrivateMessageRequest request = this;
            HttpPostRequestBuilder endpoint = new HttpPostRequestBuilder("private.php");
            endpoint.AddParameter("prevmessageid", request.PrivateMessageId);
            endpoint.AddParameter("action", SEND_MESSAGE_ACTION_VALUE);
            endpoint.AddParameter("forward", request.IsForward ? "yes" : string.Empty);
            endpoint.AddParameter("touser", request.To);
            endpoint.AddParameter("title", request.Subject);

            if (request.SelectedTag != null)
                endpoint.AddParameter("iconid", request.SelectedTag.Value);

            endpoint.AddParameter("message", request.Body);
            endpoint.AddParameter("parseurl", "yes");
            endpoint.AddParameter("savecopy", "yes");
            endpoint.AddParameter("submit", SEND_MESSAGE_SUBMIT_VALUE);
            return endpoint;
        }
Esempio n. 3
0
        private async Task<bool> PrivateMessageAPICallAsync(IEnumerable<KeyValuePair<string, string>> messageKeys,
            string destinationFolderId,
            string sourceFolderId,
            string apiAction,
            string apiValue)
        {
            var endpoint = new HttpPostRequestBuilder("private.php");
            string folderId = string.Empty;
            foreach(KeyValuePair<string, string> pair in messageKeys)
            {
                folderId = pair.Value;
                string privateMessageId = pair.Key;
                endpoint.AddParameter(string.Format("privatemessage[{0}]", privateMessageId), "yes");
            }

            endpoint.AddParameter("action", MOVE_MESSAGE_ACTION_VALUE);
            endpoint.AddParameter("thisfolder", sourceFolderId);
            endpoint.AddParameter("folderid", destinationFolderId);
            endpoint.AddParameter(apiAction, apiValue);
            bool success = false;
            try { var result = await endpoint.SendRequestAsync(this.Client); result.EnsureSuccessStatusCode(); success = true; }
            catch (Exception) { success = false; }
            return success;
        }
Esempio n. 4
0
 public Task<bool> RemoveFromBookmarkAsync(string threadid)
 {
     HttpPostRequestBuilder endpoint = new HttpPostRequestBuilder("bookmarkthreads.php");
     endpoint.AddParameter("json", "1");
     endpoint.AddParameter("action", "remove");
     endpoint.AddParameter("threadid", threadid);
     return endpoint.SendAndConfirmAsync(this.Client);
 }
 public System.Net.Http.IHttpRequestBuilder CreateHttpRequestBuilder()
 {
     var endpoint = new HttpPostRequestBuilder("private.php");
     this.GenerateRequestData(endpoint);
     return endpoint;
 }
Esempio n. 6
0
        public System.Net.Http.IHttpRequestBuilder CreateHttpRequestBuilder()
        {
            var request = new HttpPostRequestBuilder("newthread.php");
            request.AddParameter(THREAD_FORUMID_KEY, ForumId);
            request.AddParameter(THREAD_ACTION_KEY, THREAD_ACTION_VALUE);
            request.AddParameter(THREAD_FORMCOOKIE_KEY, FormCookie);
            request.AddParameter(THREAD_FORMKEY_KEY, FormKey);
            request.AddParameter(THREAD_SUBJECT_KEY, Title);
            request.AddParameter(THREAD_ICONID_KEY, SelectedTag.Value);
            request.AddParameter(THREAD_MESSAGE_KEY, Text);
            request.AddParameter(THREAD_PARSEURL_KEY, THREAD_PARSEURL_VALUE);

            request.AddParameter(IsPreview ? PREVIEW_THREAD_SUBMIT_KEY : SEND_THREAD_SUBMIT_KEY,
                IsPreview ? PREVIEW_THERAD_SUBMIT_VALUE : SEND_THREAD_SUBMIT_VALUE);

            return request;
        }