diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | doc/en/weechat_plugin_api.en.txt | 62 | ||||
-rw-r--r-- | doc/fr/weechat_plugin_api.fr.txt | 59 | ||||
-rw-r--r-- | doc/it/weechat_plugin_api.it.txt | 70 | ||||
-rw-r--r-- | src/gui/gui-nicklist.c | 48 |
5 files changed, 231 insertions, 12 deletions
@@ -1,7 +1,7 @@ WeeChat ChangeLog ================= Sébastien Helleu <flashcode@flashtux.org> -v0.4.1-dev, 2013-03-07 +v0.4.1-dev, 2013-03-08 This document lists all changes for each version. @@ -14,6 +14,8 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] Version 0.4.1 (under dev!) -------------------------- +* core: add signals nicklist_{group|nick}_removing and hsignals + nicklist_{group|nick}_{added|removing|changed} * core: add count for groups, nicks, and total in nicklist * core: allow read of array in hdata without using index * core: add option "dirs" for command /debug diff --git a/doc/en/weechat_plugin_api.en.txt b/doc/en/weechat_plugin_api.en.txt index c83461dc7..bba3f6147 100644 --- a/doc/en/weechat_plugin_api.en.txt +++ b/doc/en/weechat_plugin_api.en.txt @@ -7896,6 +7896,11 @@ Arguments: string: buffer pointer + "," + group name | group changed in nicklist +| weechat | nicklist_group_removing + + (_new in version 0.4.1_) | + string: buffer pointer + "," + group name | + removing group from nicklist + | weechat | nicklist_group_removed + (_new in version 0.3.2_) | string: buffer pointer + "," + group name | @@ -7911,6 +7916,11 @@ Arguments: string: buffer pointer + "," + nick name | nick changed in nicklist +| weechat | nicklist_nick_removing + + (_new in version 0.4.1_) | + string: buffer pointer + "," + nick name | + removing nick from nicklist + | weechat | nicklist_nick_removed + (_new in version 0.3.2_) | string: buffer pointer + "," + nick name | @@ -8286,12 +8296,56 @@ Arguments: * 'signal': signal to catch, can begin or end with "*" (priority allowed, see note about <<hook_priority,priority>>): -[width="100%",cols="^1,^3,5",options="header"] +[width="100%",cols="^1,^3,5,5",options="header"] |======================================== -| Plugin | Signal | Arguments +| Plugin | Signal | Arguments | Description + +| irc | irc_redirection_xxx_yyy ^(1)^ + + (_new in version 0.3.4_) | + see <<hsignal_irc_redirect_command,hsignal_irc_redirect_command>> | + redirection output + +| weechat | nicklist_group_added + + (_new in version 0.4.1_) | + 'buffer' ('struct t_gui_buffer *'): buffer + + 'parent_group' ('struct t_gui_nick_group *'): parent group + + 'group' ('struct t_gui_nick_group *'): group | + group added in nicklist + +| weechat | nicklist_nick_added + + (_new in version 0.4.1_) | + 'buffer' ('struct t_gui_buffer *'): buffer + + 'parent_group' ('struct t_gui_nick_group *'): parent group + + 'nick' ('struct t_gui_nick *'): nick | + nick added in nicklist + +| weechat | nicklist_group_removing + + (_new in version 0.4.1_) | + 'buffer' ('struct t_gui_buffer *'): buffer + + 'parent_group' ('struct t_gui_nick_group *'): parent group + + 'group' ('struct t_gui_nick_group *'): group | + removing group from nicklist + +| weechat | nicklist_nick_removing + + (_new in version 0.4.1_) | + 'buffer' ('struct t_gui_buffer *'): buffer + + 'parent_group' ('struct t_gui_nick_group *'): parent group + + 'nick' ('struct t_gui_nick *'): nick | + removing nick from nicklist -| irc | irc_redirection_xxx_yyy ^(1)^ | - redirection output (see <<hsignal_irc_redirect_command>>) +| weechat | nicklist_group_changed + + (_new in version 0.4.1_) | + 'buffer' ('struct t_gui_buffer *'): buffer + + 'parent_group' ('struct t_gui_nick_group *'): parent group + + 'group' ('struct t_gui_nick_group *'): group | + group changed in nicklist + +| weechat | nicklist_nick_changed + + (_new in version 0.4.1_) | + 'buffer' ('struct t_gui_buffer *'): buffer + + 'parent_group' ('struct t_gui_nick_group *'): parent group + + 'nick' ('struct t_gui_nick *'): nick | + nick changed in nicklist |======================================== [NOTE] diff --git a/doc/fr/weechat_plugin_api.fr.txt b/doc/fr/weechat_plugin_api.fr.txt index 45b232975..50de6e136 100644 --- a/doc/fr/weechat_plugin_api.fr.txt +++ b/doc/fr/weechat_plugin_api.fr.txt @@ -8009,6 +8009,11 @@ Paramètres : chaîne : pointeur tampon + "," + nom du groupe | groupe modifié dans la liste des pseudos +| weechat | nicklist_group_removing + + (_nouveau dans la version 0.4.1_) | + chaîne : pointeur tampon + "," + nom du groupe | + suppression du groupe de la liste des pseudos + | weechat | nicklist_group_removed + (_nouveau dans la version 0.3.2_) | chaîne : pointeur tampon + "," + nom du groupe | @@ -8024,6 +8029,11 @@ Paramètres : chaîne : pointeur tampon + "," + pseudo | pseudo modifié dans la liste des pseudos +| weechat | nicklist_nick_removing + + (_nouveau dans la version 0.4.1_) | + chaîne : pointeur tampon + "," + pseudo | + suppression du pseudo de la liste des pseudos + | weechat | nicklist_nick_removed + (_nouveau dans la version 0.3.2_) | chaîne : pointeur tampon + "," + pseudo | @@ -8408,12 +8418,55 @@ Paramètres : * 'signal' : signal à intercepter, peut commencer ou se terminer par "*" (priorité autorisée, voir la note sur la <<hook_priority,priorité>>) : -[width="100%",cols="^1,^3,5",options="header"] +[width="100%",cols="^1,^3,5,5",options="header"] |======================================== -| Extension | Signal | Paramètres +| Extension | Signal | Paramètres | Description -| irc | irc_redirection_xxx_yyy ^(1)^ | +| irc | irc_redirection_xxx_yyy ^(1)^ + + (_nouveau dans la version 0.3.4_) | sortie de la redirection (voir <<hsignal_irc_redirect_command>>) + +| weechat | nicklist_group_added + + (_nouveau dans la version 0.4.1_) | + 'buffer' ('struct t_gui_buffer *') : tampon + + 'parent_group' ('struct t_gui_nick_group *') : groupe parent + + 'group' ('struct t_gui_nick_group *') : groupe | + group added in nicklist + +| weechat | nicklist_nick_added + + (_nouveau dans la version 0.4.1_) | + 'buffer' ('struct t_gui_buffer *') : tampon + + 'parent_group' ('struct t_gui_nick_group *') : groupe parent + + 'nick' ('struct t_gui_nick *') : pseudo | + nick added in nicklist + +| weechat | nicklist_group_removing + + (_nouveau dans la version 0.4.1_) | + 'buffer' ('struct t_gui_buffer *') : tampon + + 'parent_group' ('struct t_gui_nick_group *') : groupe parent + + 'group' ('struct t_gui_nick_group *') : groupe | + removing group from nicklist + +| weechat | nicklist_nick_removing + + (_nouveau dans la version 0.4.1_) | + 'buffer' ('struct t_gui_buffer *') : tampon + + 'parent_group' ('struct t_gui_nick_group *') : groupe parent + + 'nick' ('struct t_gui_nick *') : pseudo | + removing nick from nicklist + +| weechat | nicklist_group_changed + + (_nouveau dans la version 0.4.1_) | + 'buffer' ('struct t_gui_buffer *') : tampon + + 'parent_group' ('struct t_gui_nick_group *') : groupe parent + + 'group' ('struct t_gui_nick_group *') : groupe | + group changed in nicklist + +| weechat | nicklist_nick_changed + + (_nouveau dans la version 0.4.1_) | + 'buffer' ('struct t_gui_buffer *') : tampon + + 'parent_group' ('struct t_gui_nick_group *') : parent + + 'nick' ('struct t_gui_nick *') : pseudo | + nick changed in nicklist |======================================== [NOTE] diff --git a/doc/it/weechat_plugin_api.it.txt b/doc/it/weechat_plugin_api.it.txt index b22fc6684..e4c83c0ec 100644 --- a/doc/it/weechat_plugin_api.it.txt +++ b/doc/it/weechat_plugin_api.it.txt @@ -7977,6 +7977,12 @@ Argomenti: group changed in nicklist // TRANSLATION MISSING +| weechat | nicklist_group_removing + + (_novità nella versione 0.4.1_) | + string: buffer pointer + "," + group name | + removing group from nicklist + +// TRANSLATION MISSING | weechat | nicklist_group_removed + (_novità nella versione 0.3.2_) | string: buffer pointer + "," + group name | @@ -7995,6 +8001,12 @@ Argomenti: nick changed in nicklist // TRANSLATION MISSING +| weechat | nicklist_nick_removing + + (_novità nella versione 0.4.1_) | + string: buffer pointer + "," + nick name | + removing nick from nicklist + +// TRANSLATION MISSING | weechat | nicklist_nick_removed + (_novità nella versione 0.3.2_) | string: buffer pointer + "," + nick name | @@ -8387,12 +8399,62 @@ Argomenti: * 'signal': segnale da catturare, può iniziare o terminare con "*" (priorità consentita, consultare la nota a proposito di <<hook_priority,priority>>): -[width="100%",cols="^1,^3,5",options="header"] +[width="100%",cols="^1,^3,5,5",options="header"] |======================================== -| Plugin | Segnale | Argomenti +| Plugin | Segnale | Argomenti | Descrizione + +| irc | irc_redirection_xxx_yyy ^(1)^ + + (_novità nella versione 0.3.4_) | + consultare <<hsignal_irc_redirect_command,hsignal_irc_redirect_command>> | + redirection output + +// TRANSLATION MISSING +| weechat | nicklist_group_added + + (_novità nella versione 0.4.1_) | + 'buffer' ('struct t_gui_buffer *'): buffer + + 'parent_group' ('struct t_gui_nick_group *'): parent group + + 'group' ('struct t_gui_nick_group *'): group | + group added in nicklist + +// TRANSLATION MISSING +| weechat | nicklist_nick_added + + (_novità nella versione 0.4.1_) | + 'buffer' ('struct t_gui_buffer *'): buffer + + 'parent_group' ('struct t_gui_nick_group *'): parent group + + 'nick' ('struct t_gui_nick *'): nick | + nick added in nicklist + +// TRANSLATION MISSING +| weechat | nicklist_group_removing + + (_novità nella versione 0.4.1_) | + 'buffer' ('struct t_gui_buffer *'): buffer + + 'parent_group' ('struct t_gui_nick_group *'): parent group + + 'group' ('struct t_gui_nick_group *'): group | + removing group from nicklist + +// TRANSLATION MISSING +| weechat | nicklist_nick_removing + + (_novità nella versione 0.4.1_) | + 'buffer' ('struct t_gui_buffer *'): buffer + + 'parent_group' ('struct t_gui_nick_group *'): parent group + + 'nick' ('struct t_gui_nick *'): nick | + removing nick from nicklist -| irc | irc_redirection_xxx_yyy ^(1)^ | - redirection output (consultare <<hsignal_irc_redirect_command>>) +// TRANSLATION MISSING +| weechat | nicklist_group_changed + + (_novità nella versione 0.4.1_) | + 'buffer' ('struct t_gui_buffer *'): buffer + + 'parent_group' ('struct t_gui_nick_group *'): parent group + + 'group' ('struct t_gui_nick_group *'): group | + group changed in nicklist + +// TRANSLATION MISSING +| weechat | nicklist_nick_changed + + (_novità nella versione 0.4.1_) | + 'buffer' ('struct t_gui_buffer *'): buffer + + 'parent_group' ('struct t_gui_nick_group *'): parent group + + 'nick' ('struct t_gui_nick *'): nick | + nick changed in nicklist |======================================== [NOTE] diff --git a/src/gui/gui-nicklist.c b/src/gui/gui-nicklist.c index d03fe3175..e0e21eb77 100644 --- a/src/gui/gui-nicklist.c +++ b/src/gui/gui-nicklist.c @@ -35,6 +35,7 @@ #include "../core/weechat.h" #include "../core/wee-config.h" +#include "../core/wee-hashtable.h" #include "../core/wee-hdata.h" #include "../core/wee-hook.h" #include "../core/wee-infolist.h" @@ -47,6 +48,9 @@ #include "gui-color.h" +struct t_hashtable *gui_nicklist_hsignal = NULL; + + /* * Sends a signal when something has changed in nicklist. */ @@ -80,6 +84,40 @@ gui_nicklist_send_signal (const char *signal, struct t_gui_buffer *buffer, } /* + * Sends a hsignal when something will change or has changed in nicklist. + */ + +void +gui_nicklist_send_hsignal (const char *signal, struct t_gui_buffer *buffer, + struct t_gui_nick_group *group, + struct t_gui_nick *nick) +{ + if (!gui_nicklist_hsignal) + { + gui_nicklist_hsignal = hashtable_new (32, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_POINTER, + NULL, + NULL); + } + + if (!gui_nicklist_hsignal) + return; + + hashtable_remove_all (gui_nicklist_hsignal); + + hashtable_set (gui_nicklist_hsignal, "buffer", buffer); + hashtable_set (gui_nicklist_hsignal, "parent_group", + (group) ? group->parent : nick->group); + if (group) + hashtable_set (gui_nicklist_hsignal, "group", group); + if (nick) + hashtable_set (gui_nicklist_hsignal, "nick", nick); + + hook_hsignal_send (signal, gui_nicklist_hsignal); +} + +/* * Searches for position of a group (to keep nicklist sorted). */ @@ -259,6 +297,7 @@ gui_nicklist_add_group (struct t_gui_buffer *buffer, buffer->nicklist_visible_count++; gui_nicklist_send_signal ("nicklist_group_added", buffer, name); + gui_nicklist_send_hsignal ("nicklist_group_added", buffer, new_group, NULL); return new_group; } @@ -421,6 +460,7 @@ gui_nicklist_add_nick (struct t_gui_buffer *buffer, gui_buffer_ask_chat_refresh (buffer, 1); gui_nicklist_send_signal ("nicklist_nick_added", buffer, name); + gui_nicklist_send_hsignal ("nicklist_nick_added", buffer, NULL, new_nick); return new_nick; } @@ -440,6 +480,9 @@ gui_nicklist_remove_nick (struct t_gui_buffer *buffer, nick_removed = (nick->name) ? strdup (nick->name) : NULL; + gui_nicklist_send_signal ("nicklist_nick_removing", buffer, nick_removed); + gui_nicklist_send_hsignal ("nicklist_nick_removing", buffer, NULL, nick); + /* remove nick from list */ if (nick->prev_nick) (nick->prev_nick)->next_nick = nick->next_nick; @@ -507,6 +550,9 @@ gui_nicklist_remove_group (struct t_gui_buffer *buffer, gui_nicklist_remove_nick (buffer, group->nicks); } + gui_nicklist_send_signal ("nicklist_group_removing", buffer, group_removed); + gui_nicklist_send_hsignal ("nicklist_group_removing", buffer, group, NULL); + if (group->parent) { /* remove group from list */ @@ -855,6 +901,7 @@ gui_nicklist_group_set (struct t_gui_buffer *buffer, { gui_nicklist_send_signal ("nicklist_group_changed", buffer, group->name); + gui_nicklist_send_hsignal ("nicklist_group_changed", buffer, group, NULL); } } @@ -979,6 +1026,7 @@ gui_nicklist_nick_set (struct t_gui_buffer *buffer, { gui_nicklist_send_signal ("nicklist_nick_changed", buffer, nick->name); + gui_nicklist_send_hsignal ("nicklist_nick_changed", buffer, NULL, nick); } } |