diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-10-11 21:35:37 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-10-13 13:13:01 +0200 |
commit | 77ed51898157d99112be7550471ec06e32344c9e (patch) | |
tree | 0645274d0f13b4fa6940d4054f74a070611a8ef0 /src/plugins/ImageBoard.cpp | |
parent | da89ec98fb34757f0c46dc8cb2dd87ae78d317ce (diff) |
Refactor plugin into seperate pages
TODO: Readd 4chan login page, manganelo creators page, autocomplete
Diffstat (limited to 'src/plugins/ImageBoard.cpp')
-rw-r--r-- | src/plugins/ImageBoard.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
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 |