From ae892d2893aa78e5c9674aed0134c9ef64a518ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Thu, 11 Apr 2024 22:50:39 +0200 Subject: [PATCH] core: use nick offline highlight color for prefix of action message when the nick is offline with a highlight --- ChangeLog.adoc | 1 + src/gui/gui-line.c | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 4b68cc1dd..e337dcdfc 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -47,6 +47,7 @@ New features:: Bug fixes:: + * core: use nick offline highlight color for prefix of action message when the nick is offline with a highlight * core: add missing hdata name "buffer" in hdata "hotlist" * core: fix reset to initial scroll position after search of text in buffer (issue #2093) * core: add missing mouse events "alt-ctrl-button2" and "alt-ctrl-button3" diff --git a/src/gui/gui-line.c b/src/gui/gui-line.c index 675b6d23d..5ec6b0da8 100644 --- a/src/gui/gui-line.c +++ b/src/gui/gui-line.c @@ -1071,17 +1071,17 @@ gui_line_has_offline_nick (struct t_gui_line *line) { const char *nick; - if (line && gui_line_search_tag_starting_with (line, "prefix_nick")) + if (!line) + return 0; + + nick = gui_line_get_nick_tag (line); + if (nick + && (line->data->buffer->nicklist_root + && (line->data->buffer->nicklist_root->nicks + || line->data->buffer->nicklist_root->children)) + && !gui_nicklist_search_nick (line->data->buffer, NULL, nick)) { - nick = gui_line_get_nick_tag (line); - if (nick - && (line->data->buffer->nicklist_root - && (line->data->buffer->nicklist_root->nicks - || line->data->buffer->nicklist_root->children)) - && !gui_nicklist_search_nick (line->data->buffer, NULL, nick)) - { - return 1; - } + return 1; } return 0;