From 89c41c1488854858e02ff6bd48a6518161fa05a5 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 22 Nov 2022 01:44:39 +0100 Subject: Allow launching directly into 4chan thread --- plugins/Fourchan.hpp | 2 ++ plugins/ImageBoard.hpp | 12 +++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/Fourchan.hpp b/plugins/Fourchan.hpp index 83fb293..51fe880 100644 --- a/plugins/Fourchan.hpp +++ b/plugins/Fourchan.hpp @@ -60,6 +60,8 @@ namespace QuickMedia { FourchanThreadPage(Program *program, std::string board_id, std::string thread_id, std::string pass_id) : ImageBoardThreadPage(program, std::move(board_id), std::move(thread_id)), pass_id(std::move(pass_id)) {} + PluginResult lazy_fetch(BodyItems &result_items) override; + PostResult post_comment(const std::string &captcha_id, const std::string &captcha_solution, const std::string &comment, const std::string &filepath = "") override; const std::string& get_pass_id() override; PluginResult request_captcha_challenge(ImageBoardCaptchaChallenge &challenge_response) override; diff --git a/plugins/ImageBoard.hpp b/plugins/ImageBoard.hpp index b324ea9..e135532 100644 --- a/plugins/ImageBoard.hpp +++ b/plugins/ImageBoard.hpp @@ -30,15 +30,14 @@ namespace QuickMedia { int ttl = 0; }; - class ImageBoardThreadPage : public VideoPage { + class ImageBoardThreadPage : public LazyFetchPage { public: - ImageBoardThreadPage(Program *program, std::string board_id, std::string thread_id) : VideoPage(program, ""), board_id(std::move(board_id)), thread_id(std::move(thread_id)) {} + ImageBoardThreadPage(Program *program, std::string board_id, std::string thread_id) : LazyFetchPage(program), board_id(std::move(board_id)), thread_id(std::move(thread_id)) {} const char* get_title() const override { return ""; } PageTypez get_type() const override { return PageTypez::IMAGE_BOARD_THREAD; } void copy_to_clipboard(const BodyItem *body_item) override; - bool autoplay_next_item() override { return true; } // If |filepath| is empty then no file is uploaded virtual PostResult post_comment(const std::string &captcha_id, const std::string &captcha_solution, const std::string &comment, const std::string &filepath = "") = 0; virtual const std::string& get_pass_id(); @@ -48,4 +47,11 @@ namespace QuickMedia { const std::string board_id; const std::string thread_id; }; + + class ImageBoardVideoPage : public VideoPage { + public: + ImageBoardVideoPage(Program *program) : VideoPage(program, "") {} + const char* get_title() const override { return ""; } + bool autoplay_next_item() override { return true; } + }; } \ No newline at end of file -- cgit v1.2.3