aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Fourchan.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-05-03 01:48:19 +0200
committerdec05eba <dec05eba@protonmail.com>2021-05-03 01:48:19 +0200
commitab5065e541cb6f84b11062892ce25f033c7fa82d (patch)
tree6b593e19f035407687e5c2c6a7f951b063fb7a4a /src/plugins/Fourchan.cpp
parentd1f1683bc44ebc51b45083280adabf60d0dd27d7 (diff)
Add readm.org
Diffstat (limited to 'src/plugins/Fourchan.cpp')
-rw-r--r--src/plugins/Fourchan.cpp7
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;
}