aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/QuickMedia.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index da22d72..424ccbb 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -2082,7 +2082,7 @@ namespace QuickMedia {
std::vector<CommandArg> extra_args;
if(strcmp(images_page->get_service_name(), "manganelo") == 0) {
extra_args = {
- CommandArg { "-H", "accept: image/webp,image/apng,image/*,*/*;q=0.8" },
+ CommandArg { "-H", "accept: image/png,image/*,*/*;q=0.8" },
CommandArg { "-H", "sec-fetch-site: cross-site" },
CommandArg { "-H", "sec-fetch-mode: no-cors" },
CommandArg { "-H", "sec-fetch-dest: image" },
@@ -3627,7 +3627,7 @@ namespace QuickMedia {
int fetch_message_tab = -1;
// TODO: How about instead fetching all messages we have, not only the visible ones? also fetch with multiple threads.
- tabs[PINNED_TAB_INDEX].body->body_item_render_callback = [this, &current_room, &fetch_message_future, &tabs, &fetch_message, &find_body_item_by_event_id, &fetch_body_item, &fetch_message_tab](BodyItem *body_item) {
+ tabs[PINNED_TAB_INDEX].body->body_item_render_callback = [this, &current_room, &me, &fetch_message_future, &tabs, &fetch_message, &find_body_item_by_event_id, &fetch_body_item, &fetch_message_tab](BodyItem *body_item) {
if(fetch_message_future.valid())
return;
@@ -3658,6 +3658,8 @@ namespace QuickMedia {
// TODO: Optimize from linear search to hash map
auto related_body_item = find_body_item_by_event_id(tabs[MESSAGES_TAB_INDEX].body->items.data(), tabs[MESSAGES_TAB_INDEX].body->items.size(), event_data->message->related_event_id);
if(related_body_item) {
+ if(related_body_item->userdata && static_cast<Message*>(related_body_item->userdata)->user == me)
+ body_item->set_description_color(sf::Color(255, 100, 100));
body_item->embedded_item = std::make_shared<BodyItem>("");
*body_item->embedded_item = *related_body_item;
body_item->embedded_item_status = FetchStatus::FINISHED_LOADING;
@@ -3682,6 +3684,8 @@ namespace QuickMedia {
// TODO: Optimize from linear search to hash map
auto related_body_item = find_body_item_by_event_id(tabs[MESSAGES_TAB_INDEX].body->items.data(), tabs[MESSAGES_TAB_INDEX].body->items.size(), event_data->event_id);
if(related_body_item) {
+ if(related_body_item->userdata && static_cast<Message*>(related_body_item->userdata)->user == me)
+ body_item->set_description_color(sf::Color(255, 100, 100));
*body_item = *related_body_item;
event_data->status = FetchStatus::FINISHED_LOADING;
event_data->message = static_cast<Message*>(related_body_item->userdata);
@@ -3700,7 +3704,7 @@ namespace QuickMedia {
};
// TODO: How about instead fetching all messages we have, not only the visible ones? also fetch with multiple threads.
- tabs[MESSAGES_TAB_INDEX].body->body_item_render_callback = [this, &current_room, &fetch_message_future, &tabs, &fetch_message, &find_body_item_by_event_id, &fetch_body_item, &fetch_message_tab](BodyItem *body_item) {
+ tabs[MESSAGES_TAB_INDEX].body->body_item_render_callback = [this, &current_room, &me, &fetch_message_future, &tabs, &fetch_message, &find_body_item_by_event_id, &fetch_body_item, &fetch_message_tab](BodyItem *body_item) {
Message *message = static_cast<Message*>(body_item->userdata);
if(!message)
return;
@@ -3732,6 +3736,8 @@ namespace QuickMedia {
// TODO: Optimize from linear search to hash map
auto related_body_item = find_body_item_by_event_id(tabs[MESSAGES_TAB_INDEX].body->items.data(), tabs[MESSAGES_TAB_INDEX].body->items.size(), message->related_event_id);
if(related_body_item) {
+ if(related_body_item->userdata && static_cast<Message*>(related_body_item->userdata)->user == me)
+ body_item->set_description_color(sf::Color(255, 100, 100));
body_item->embedded_item = std::make_shared<BodyItem>("");
*body_item->embedded_item = *related_body_item;
body_item->embedded_item_status = FetchStatus::FINISHED_LOADING;
@@ -4521,6 +4527,8 @@ namespace QuickMedia {
}
} else if(fetch_message_tab == MESSAGES_TAB_INDEX) {
if(fetch_message_result.message) {
+ if(fetch_message_result.message->user == me)
+ fetch_body_item->set_description_color(sf::Color(255, 100, 100));
fetch_body_item->embedded_item = message_to_body_item(current_room, fetch_message_result.message.get(), current_room->get_user_display_name(me), me->user_id);
fetch_body_item->embedded_item_status = FetchStatus::FINISHED_LOADING;
} else {
@@ -4713,7 +4721,7 @@ namespace QuickMedia {
fetched_messages_set.insert(message->event_id);
}
all_messages.insert(all_messages.end(), all_messages_new.begin(), all_messages_new.end());
- me = matrix->get_me(current_room);
+ //me = matrix->get_me(current_room);
filter_sent_messages(all_messages_new);
add_new_messages_to_current_room(all_messages_new);
modify_related_messages_in_current_room(all_messages_new);