From 6d266984a4729f09eda42027d6781d26eb198d25 Mon Sep 17 00:00:00 2001 From: MarcoPolo-PasTonMolo Date: Mon, 13 Feb 2023 23:40:58 +0200 Subject: Fix quote and url autocompletion for MAM and history After adding MAM quote and url autocompletion wouldn't pick up messages from MAM or history(from DB) or would have them in the wrong order. This commit fixes that. Fixes https://github.com/profanity-im/profanity/issues/1770 --- src/ui/window.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/ui/window.c') diff --git a/src/ui/window.c b/src/ui/window.c index 9d7b779e..4bbec7a4 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -35,6 +35,7 @@ */ #include "config.h" +#include "ui/window_list.h" #include #include @@ -1498,6 +1499,8 @@ win_print_history(ProfWin* window, const ProfMessage* const message) jid_destroy(jidp); buffer_append(window->layout->buffer, "-", 0, message->timestamp, flags, THEME_TEXT_HISTORY, display_name, NULL, message->plain, NULL, NULL); + wins_add_urls_ac(window, message, FALSE); + wins_add_quotes_ac(window, message->plain, FALSE); _win_print_internal(window, "-", 0, message->timestamp, flags, THEME_TEXT_HISTORY, display_name, message->plain, NULL); free(display_name); @@ -1526,6 +1529,8 @@ win_print_old_history(ProfWin* window, const ProfMessage* const message) jid_destroy(jidp); buffer_prepend(window->layout->buffer, "-", 0, message->timestamp, flags, THEME_TEXT_HISTORY, display_name, NULL, message->plain, NULL, NULL); + wins_add_urls_ac(window, message, TRUE); + wins_add_quotes_ac(window, message->plain, TRUE); _win_print_internal(window, "-", 0, message->timestamp, flags, THEME_TEXT_HISTORY, display_name, message->plain, NULL); free(display_name); -- cgit 1.4.1-2-gfad0