aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Fourchan.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-11-07 14:23:49 +0100
committerdec05eba <dec05eba@protonmail.com>2022-11-07 14:24:32 +0100
commitc65a57e884de51cade584e3f01c7c5627aa6ebd8 (patch)
tree8dfdff1f60c83f15b354e415534bc4f7b62db6f7 /src/plugins/Fourchan.cpp
parentf791d96362cbe7ef8435e999adaaf05e6f2683a5 (diff)
Matrix: fix edit being replaced with old message when re-entering the room (without restart)
Add quote colors to 4chan, monospace for codeblocks
Diffstat (limited to 'src/plugins/Fourchan.cpp')
-rw-r--r--src/plugins/Fourchan.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/plugins/Fourchan.cpp b/src/plugins/Fourchan.cpp
index 4cfaeaa..c58d942 100644
--- a/src/plugins/Fourchan.cpp
+++ b/src/plugins/Fourchan.cpp
@@ -260,35 +260,38 @@ namespace QuickMedia {
comment_text += std::move(cp.text);
break;
case CommentPiece::Type::QUOTE:
- comment_text += std::move(cp.text);
+ comment_text += Text::formatted_text(std::move(cp.text), mgl::Color(120, 153, 34), FORMATTED_TEXT_FLAG_COLOR);
break;
case CommentPiece::Type::QUOTE_CONTINUE:
- comment_text += std::move(cp.text);
+ comment_text += Text::formatted_text(std::move(cp.text), mgl::Color(120, 153, 34), FORMATTED_TEXT_FLAG_COLOR);
break;
case CommentPiece::Type::QUOTELINK: {
- comment_text += std::move(cp.text);
auto it = comment_by_postno.find(cp.quote_postnumber);
if(it == comment_by_postno.end()) {
// TODO: Link this quote to a 4chan archive that still has the quoted comment (if available)
- comment_text += " (Dead)";
+ comment_text += Text::formatted_text(std::move(cp.text) + " (DEAD)", get_theme().attention_alert_text_color, FORMATTED_TEXT_FLAG_COLOR);
} else {
result_items[body_item_index]->replies_to.push_back(it->second);
result_items[it->second]->replies.push_back(body_item_index);
result_items[it->second]->add_reaction(">>" + result_items[body_item_index]->post_number, nullptr, get_theme().replies_text_color);
+ if(it->second == 0)
+ comment_text += Text::formatted_text(std::move(cp.text) + " (OP)", get_theme().attention_alert_text_color, FORMATTED_TEXT_FLAG_COLOR);
+ else
+ comment_text += Text::formatted_text(std::move(cp.text), get_theme().attention_alert_text_color, FORMATTED_TEXT_FLAG_COLOR);
}
break;
}
case CommentPiece::Type::DEADLINK:
// TODO: Link this quote to a 4chan archive that still has the quoted comment (if available)
- comment_text += std::move(cp.text) + " (Dead)";
+ comment_text += Text::formatted_text(std::move(cp.text) + " (DEAD)", get_theme().attention_alert_text_color, FORMATTED_TEXT_FLAG_COLOR);
break;
case CommentPiece::Type::CROSSBOARD_LINK:
// TODO: Link this to another thread and allow navigating to it
- comment_text += std::move(cp.text) + " (Cross-thread)";
+ comment_text += Text::formatted_text(std::move(cp.text) + " (Cross-thread)", get_theme().attention_alert_text_color, FORMATTED_TEXT_FLAG_COLOR);
break;
case CommentPiece::Type::CODEBLOCK:
- // TODO: Use a different colored background and use a monospace font
- comment_text += std::move(cp.text);
+ // TODO: Use a different colored background
+ comment_text += Text::formatted_text(std::move(cp.text), mgl::Color(255, 255, 255, 255), FORMATTED_TEXT_FLAG_MONOSPACE);
break;
}
});