summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2021-12-28 13:52:58 +0100
committerSébastien Helleu <flashcode@flashtux.org>2021-12-28 13:52:58 +0100
commitdd2b19ec42e72d4fdc540774a9899dd526f4d0e4 (patch)
tree963da0bfdf10278eab151fd07431111cee63e4d5
parentdf0506dbdf913af318c660fec7b72ebd24565e80 (diff)
downloadweechat-dd2b19ec42e72d4fdc540774a9899dd526f4d0e4.zip
core: fix display of hotlist in buflist after changing value of option weechat.look.hotlist_sort (closes #1733)
The "hotlist" pointer in buffers was lost, it is now set again after switching to the newly sorted hotlist.
-rw-r--r--ChangeLog.adoc1
-rw-r--r--src/gui/gui-hotlist.c11
2 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc
index 006d5bda1..486f59196 100644
--- a/ChangeLog.adoc
+++ b/ChangeLog.adoc
@@ -24,6 +24,7 @@ New features::
Bug fixes::
+ * core: fix display of hotlist in buflist after changing value of option weechat.look.hotlist_sort (issue #1733)
* irc: fix display of IRC numeric messages with no parameters
Tests::
diff --git a/src/gui/gui-hotlist.c b/src/gui/gui-hotlist.c
index 2de62215c..5aee49333 100644
--- a/src/gui/gui-hotlist.c
+++ b/src/gui/gui-hotlist.c
@@ -166,7 +166,7 @@ gui_hotlist_free_all (struct t_gui_hotlist **hotlist,
/* remove all hotlists */
while (*hotlist)
{
- gui_hotlist_free (hotlist, last_hotlist, *hotlist, 1);
+ gui_hotlist_free (hotlist, last_hotlist, *hotlist, 0);
}
}
@@ -504,11 +504,20 @@ gui_hotlist_resort ()
gui_hotlist_add_hotlist (&new_hotlist, &last_new_hotlist, element);
}
+ /* clear whole hotlist */
gui_hotlist_free_all (&gui_hotlist, &last_gui_hotlist);
+ /* switch to new sorted hotlist */
gui_hotlist = new_hotlist;
last_gui_hotlist = last_new_hotlist;
+ /* reassign hotlist in buffers */
+ for (ptr_hotlist = gui_hotlist; ptr_hotlist;
+ ptr_hotlist = ptr_hotlist->next_hotlist)
+ {
+ ptr_hotlist->buffer->hotlist = ptr_hotlist;
+ }
+
gui_hotlist_changed_signal (NULL);
}