aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Fourchan.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-09-30 19:07:05 +0200
committerdec05eba <dec05eba@protonmail.com>2020-09-30 19:08:05 +0200
commite1a8d10b61c5f8ca092ba3aa458b661da29ba447 (patch)
tree4de5ca75c3d19e4bd4c5c25a4362768b3e994326 /src/plugins/Fourchan.cpp
parent86d228bfc3e9c81c011c31bc81a908a21f975bfb (diff)
Matrix: add message replying with ctrl+r, also use shared_ptr for BodyItem
Diffstat (limited to 'src/plugins/Fourchan.cpp')
-rw-r--r--src/plugins/Fourchan.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/Fourchan.cpp b/src/plugins/Fourchan.cpp
index 5da2961..fa5e9e3 100644
--- a/src/plugins/Fourchan.cpp
+++ b/src/plugins/Fourchan.cpp
@@ -105,7 +105,7 @@ namespace QuickMedia {
if(board_id.isString() && board_title.isString() && board_description.isString()) {
std::string board_description_str = board_description.asString();
html_unescape_sequences(board_description_str);
- auto body_item = std::make_unique<BodyItem>("/" + board_id.asString() + "/ " + board_title.asString());
+ auto body_item = BodyItem::create("/" + board_id.asString() + "/ " + board_title.asString());
body_item->url = board_id.asString();
result_items.emplace_back(std::move(body_item));
}
@@ -320,7 +320,7 @@ namespace QuickMedia {
}
}
}
- auto body_item = std::make_unique<BodyItem>(std::move(comment_text));
+ auto body_item = BodyItem::create(std::move(comment_text));
body_item->url = std::to_string(thread_num.asInt64());
const Json::Value &ext = thread["ext"];
@@ -382,7 +382,7 @@ namespace QuickMedia {
std::lock_guard<std::mutex> lock(board_list_mutex);
BodyItems body_items;
for(auto &cached_body_item : cached_thread_list_items) {
- body_items.push_back(std::make_unique<BodyItem>(*cached_body_item));
+ body_items.push_back(std::make_shared<BodyItem>(*cached_body_item));
}
return body_items;
}
@@ -432,7 +432,7 @@ namespace QuickMedia {
int64_t post_num_int = post_num.asInt64();
comment_by_postno[post_num_int] = result_items.size();
- result_items.push_back(std::make_unique<BodyItem>(""));
+ result_items.push_back(BodyItem::create(""));
result_items.back()->post_number = std::to_string(post_num_int);
}
}
@@ -602,7 +602,7 @@ namespace QuickMedia {
++it;
for(; it != cached_media_urls.end(); ++it) {
- auto body_item = std::make_unique<BodyItem>("");
+ auto body_item = BodyItem::create("");
body_item->url = *it;
body_items.push_back(std::move(body_item));
}