diff options
Diffstat (limited to 'src/plugins/Fourchan.cpp')
-rw-r--r-- | src/plugins/Fourchan.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
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<CommandArg> 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; } |