From 77ed51898157d99112be7550471ec06e32344c9e Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 11 Oct 2020 21:35:37 +0200 Subject: Refactor plugin into seperate pages TODO: Readd 4chan login page, manganelo creators page, autocomplete --- src/plugins/ImageBoard.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/plugins/ImageBoard.cpp (limited to 'src/plugins/ImageBoard.cpp') diff --git a/src/plugins/ImageBoard.cpp b/src/plugins/ImageBoard.cpp new file mode 100644 index 0000000..ac05f80 --- /dev/null +++ b/src/plugins/ImageBoard.cpp @@ -0,0 +1,30 @@ +#include "../../plugins/ImageBoard.hpp" + +namespace QuickMedia { + BodyItems ImageBoardThreadPage::get_related_media(const std::string &url) { + BodyItems body_items; + auto it = std::find(cached_media_urls.begin(), cached_media_urls.end(), url); + if(it == cached_media_urls.end()) + return body_items; + + ++it; + for(; it != cached_media_urls.end(); ++it) { + auto body_item = BodyItem::create(""); + body_item->url = *it; + body_items.push_back(std::move(body_item)); + } + return body_items; + } + + PluginResult ImageBoardThreadPage::login(const std::string &token, const std::string &pin, std::string &response_msg) { + (void)token; + (void)pin; + response_msg = "Login is not supported on this image board"; + return PluginResult::ERR; + } + + const std::string& ImageBoardThreadPage::get_pass_id() { + static std::string empty_str; + return empty_str; + } +} \ No newline at end of file -- cgit v1.2.3