aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Pornhub.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-12-18 22:47:10 +0100
committerdec05eba <dec05eba@protonmail.com>2020-12-18 22:49:33 +0100
commit4f8e4d11e51e2436b957157de86755f5f8879f61 (patch)
tree26a186264ce0ba4e72d8384a3d4be9357d37c353 /src/plugins/Pornhub.cpp
parent3ef2293fd55894c968cd44608fa813d699354c20 (diff)
Matrix: get previous messages immediately even if sync in progress
Diffstat (limited to 'src/plugins/Pornhub.cpp')
-rw-r--r--src/plugins/Pornhub.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/plugins/Pornhub.cpp b/src/plugins/Pornhub.cpp
index 1f0840e..b4e908a 100644
--- a/src/plugins/Pornhub.cpp
+++ b/src/plugins/Pornhub.cpp
@@ -6,11 +6,7 @@ extern "C" {
}
#include <string.h>
-namespace QuickMedia {
- static bool begins_with(const char *str, const char *begin_with) {
- return strncmp(str, begin_with, strlen(begin_with)) == 0;
- }
-
+namespace {
// TODO: Optimize by using HtmlStringView instead of std::string
struct HtmlElement {
std::string tag_name;
@@ -19,6 +15,16 @@ namespace QuickMedia {
HtmlElement *parent = nullptr; // ref
};
+ struct HtmlParseUserdata {
+ HtmlElement *current_html_element;
+ };
+}
+
+namespace QuickMedia {
+ static bool begins_with(const char *str, const char *begin_with) {
+ return strncmp(str, begin_with, strlen(begin_with)) == 0;
+ }
+
static void html_cleanup(HtmlElement *html_element_root) {
for(HtmlElement *child_html_element : html_element_root->children) {
html_cleanup(child_html_element);
@@ -34,10 +40,6 @@ namespace QuickMedia {
return default_value;
}
- struct HtmlParseUserdata {
- HtmlElement *current_html_element;
- };
-
static void html_page_callback(HtmlParser *html_parser, HtmlParseType parse_type, void *userdata) {
HtmlParseUserdata *parse_userdata = (HtmlParseUserdata*)userdata;
if(parse_type == HTML_PARSE_TAG_START) {