aboutsummaryrefslogtreecommitdiff
path: root/src/QuickMedia.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/QuickMedia.cpp')
-rw-r--r--src/QuickMedia.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index 494e03d..a17b721 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -4364,7 +4364,7 @@ namespace QuickMedia {
auto post_comment = [this, &comment_input, &selected_file_for_upload, &navigation_stage, &thread_page, &captcha_post_id, &captcha_solution, &last_posted_time, &has_post_timeout](std::string comment_to_post, std::string file_to_upload) {
comment_input.set_editable(false);
PostResult post_result = thread_page->post_comment(captcha_post_id, captcha_solution, comment_to_post, file_to_upload);
- if(post_result == PostResult::OK) {
+ if(post_result.type == PostResult::Type::OK) {
show_notification("QuickMedia", "Comment posted!");
navigation_stage = NavigationStage::VIEWING_COMMENTS;
comment_input.set_text("");
@@ -4377,30 +4377,30 @@ namespace QuickMedia {
Path last_posted_time_filepath;
if(get_image_board_last_posted_filepath(plugin_name, last_posted_time_filepath))
file_overwrite_atomic(last_posted_time_filepath, std::to_string(last_posted_time));
- } else if(post_result == PostResult::TRY_AGAIN) {
+ } else if(post_result.type == PostResult::Type::TRY_AGAIN) {
show_notification("QuickMedia", "Please wait before posting again");
navigation_stage = NavigationStage::VIEWING_COMMENTS;
- } else if(post_result == PostResult::INVALID_CAPTCHA) {
+ } else if(post_result.type == PostResult::Type::INVALID_CAPTCHA) {
show_notification("QuickMedia", "Invalid captcha, please try again");
navigation_stage = NavigationStage::REQUESTING_CAPTCHA;
// TODO: Need to wait before requesting need captcha?
- } else if(post_result == PostResult::BANNED) {
+ } else if(post_result.type == PostResult::Type::BANNED) {
show_notification("QuickMedia", "Failed to post comment because you are banned", Urgency::CRITICAL);
navigation_stage = NavigationStage::VIEWING_COMMENTS;
//} else if(post_result == PostResult::FILE_TOO_LARGE) {
// show_notification("QuickMedia", "Failed to post comment because the file you are trying to upload is larger than " + std::to_string((double)thread_page->get_max_upload_file_size() * 1024.0 * 1024.0) + " mb", Urgency::CRITICAL);
// navigation_stage = NavigationStage::VIEWING_COMMENTS;
- } else if(post_result == PostResult::NO_SUCH_FILE) {
+ } else if(post_result.type == PostResult::Type::NO_SUCH_FILE) {
show_notification("QuickMedia", "Failed to post comment because the file you are trying to upload no longer exists", Urgency::CRITICAL);
navigation_stage = NavigationStage::VIEWING_COMMENTS;
- } else if(post_result == PostResult::FILE_TYPE_NOT_ALLOWED) {
+ } else if(post_result.type == PostResult::Type::FILE_TYPE_NOT_ALLOWED) {
show_notification("QuickMedia", "Failed to post comment because you are trying to upload a file of a type that is not allowed", Urgency::CRITICAL);
navigation_stage = NavigationStage::VIEWING_COMMENTS;
- } else if(post_result == PostResult::UPLOAD_FAILED) {
+ } else if(post_result.type == PostResult::Type::UPLOAD_FAILED) {
show_notification("QuickMedia", "Failed to post comment because file upload failed", Urgency::CRITICAL);
navigation_stage = NavigationStage::VIEWING_COMMENTS;
- } else if(post_result == PostResult::ERR) {
- show_notification("QuickMedia", "Failed to post comment", Urgency::CRITICAL);
+ } else if(post_result.type == PostResult::Type::ERR) {
+ show_notification("QuickMedia", "Failed to post comment, reason: " + post_result.err_msg, Urgency::CRITICAL);
navigation_stage = NavigationStage::VIEWING_COMMENTS;
} else {
assert(false && "Unhandled post result");