1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-06 09:43:13 +02:00

core: add callback "nickcmp" for nick comparison in buffers

This commit is contained in:
Sebastien Helleu
2012-06-14 20:06:42 +02:00
parent b5082902b4
commit d66555f387
11 changed files with 91 additions and 3 deletions
+14
View File
@@ -494,6 +494,8 @@ gui_buffer_new (struct t_weechat_plugin *plugin,
new_buffer->nicklist_max_length = 0;
new_buffer->nicklist_display_groups = 1;
new_buffer->nicklist_visible_count = 0;
new_buffer->nickcmp_callback = NULL;
new_buffer->nickcmp_callback_data = NULL;
gui_nicklist_add_group (new_buffer, NULL, "root", NULL, 0);
/* input */
@@ -1678,6 +1680,14 @@ gui_buffer_set_pointer (struct t_gui_buffer *buffer, const char *property,
{
buffer->close_callback_data = pointer;
}
else if (string_strcasecmp (property, "nickcmp_callback") == 0)
{
buffer->nickcmp_callback = pointer;
}
else if (string_strcasecmp (property, "nickcmp_callback_data") == 0)
{
buffer->nickcmp_callback_data = pointer;
}
else if (string_strcasecmp (property, "input_callback") == 0)
{
buffer->input_callback = pointer;
@@ -3114,6 +3124,8 @@ gui_buffer_hdata_buffer_cb (void *data, const char *hdata_name)
HDATA_VAR(struct t_gui_buffer, nicklist_max_length, INTEGER, NULL);
HDATA_VAR(struct t_gui_buffer, nicklist_display_groups, INTEGER, NULL);
HDATA_VAR(struct t_gui_buffer, nicklist_visible_count, INTEGER, NULL);
HDATA_VAR(struct t_gui_buffer, nickcmp_callback, POINTER, NULL);
HDATA_VAR(struct t_gui_buffer, nickcmp_callback_data, POINTER, NULL);
HDATA_VAR(struct t_gui_buffer, input, INTEGER, NULL);
HDATA_VAR(struct t_gui_buffer, input_callback, POINTER, NULL);
HDATA_VAR(struct t_gui_buffer, input_callback_data, POINTER, NULL);
@@ -3464,6 +3476,8 @@ gui_buffer_print_log ()
log_printf (" nicklist_max_length . . : %d", ptr_buffer->nicklist_max_length);
log_printf (" nicklist_display_groups : %d", ptr_buffer->nicklist_display_groups);
log_printf (" nicklist_visible_count. : %d", ptr_buffer->nicklist_visible_count);
log_printf (" nickcmp_callback. . . . : 0x%lx", ptr_buffer->nickcmp_callback);
log_printf (" nickcmp_callback_data . : 0x%lx", ptr_buffer->nickcmp_callback_data);
log_printf (" input . . . . . . . . . : %d", ptr_buffer->input);
log_printf (" input_callback. . . . . : 0x%lx", ptr_buffer->input_callback);
log_printf (" input_callback_data . . : 0x%lx", ptr_buffer->input_callback_data);