From ab5065e541cb6f84b11062892ce25f033c7fa82d Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 3 May 2021 01:48:19 +0200 Subject: Add readm.org --- src/plugins/Fourchan.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/plugins/Fourchan.cpp') diff --git a/src/plugins/Fourchan.cpp b/src/plugins/Fourchan.cpp index 5e6a970..34cb8bf 100644 --- a/src/plugins/Fourchan.cpp +++ b/src/plugins/Fourchan.cpp @@ -540,12 +540,15 @@ namespace QuickMedia { PostResult FourchanThreadPage::post_comment(const std::string &captcha_id, const std::string &comment, const std::string &filepath) { std::string url = "https://sys.4chan.org/" + board_id + "/post"; + std::string comment_fixed = comment; + if(comment_fixed[0] == '@') + comment_fixed = "\\" + comment_fixed; std::vector additional_args = { CommandArg{"-H", "Referer: https://boards.4chan.org/"}, CommandArg{"-H", "Origin: https://boards.4chan.org"}, CommandArg{"-F", "resto=" + thread_id}, - CommandArg{"-F", "com=" + comment}, + CommandArg{"-F", "com=" + comment_fixed}, CommandArg{"-F", "mode=regist"} }; @@ -583,6 +586,8 @@ namespace QuickMedia { return PostResult::TRY_AGAIN; if(response.find("Audio streams are not allowed") != std::string::npos) return PostResult::FILE_TYPE_NOT_ALLOWED; + if(response.find("Error: Upload failed") != std::string::npos) + return PostResult::UPLOAD_FAILED; return PostResult::ERR; } -- cgit v1.2.3