diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | doc/de/weechat.de.xml | 7 | ||||
-rw-r--r-- | doc/en/weechat.en.xml | 6 | ||||
-rw-r--r-- | doc/fr/weechat.fr.xml | 7 | ||||
-rw-r--r-- | src/common/completion.c | 57 | ||||
-rw-r--r-- | weechat/ChangeLog | 2 | ||||
-rw-r--r-- | weechat/doc/de/weechat.de.xml | 7 | ||||
-rw-r--r-- | weechat/doc/en/weechat.en.xml | 6 | ||||
-rw-r--r-- | weechat/doc/fr/weechat.fr.xml | 7 | ||||
-rw-r--r-- | weechat/src/common/completion.c | 57 |
10 files changed, 158 insertions, 0 deletions
@@ -5,6 +5,8 @@ ChangeLog - 2007-05-23 Version 0.2.5 (under dev!): + * added "%M" for completion with nicks of current server (nicks on open + channels) (task #6931) * improved key bindings: now possible to bind a key on many commands, separated by semicolon (task #5444) * improved IRC long message split: use word boundary (task #6685) diff --git a/doc/de/weechat.de.xml b/doc/de/weechat.de.xml index 305375b78..1d6a7b45c 100644 --- a/doc/de/weechat.de.xml +++ b/doc/de/weechat.de.xml @@ -2306,6 +2306,13 @@ msg_handler = plugin->msg_handler_add (plugin, "KICK", <entry>Nicknamen des gegenwärtigen Servers</entry> </row> <row> + <entry><literal>%M</literal></entry> + <!-- TRANSLATION NEEDED --> + <entry> + nicks on current server (on all open channels) + </entry> + </row> + <row> <entry><literal>%n</literal></entry> <entry>Nicknamen des gegenwärtigen Channels</entry> </row> diff --git a/doc/en/weechat.en.xml b/doc/en/weechat.en.xml index 9b36f89bc..aeeb9ad08 100644 --- a/doc/en/weechat.en.xml +++ b/doc/en/weechat.en.xml @@ -2321,6 +2321,12 @@ msg_handler = plugin->msg_handler_add (plugin, "KICK", <entry>nick on current server</entry> </row> <row> + <entry><literal>%M</literal></entry> + <entry> + nicks on current server (on all open channels) + </entry> + </row> + <row> <entry><literal>%n</literal></entry> <entry>nicks of current channel</entry> </row> diff --git a/doc/fr/weechat.fr.xml b/doc/fr/weechat.fr.xml index 1e4dbd56c..93111fadb 100644 --- a/doc/fr/weechat.fr.xml +++ b/doc/fr/weechat.fr.xml @@ -2378,6 +2378,13 @@ msg_handler = plugin->msg_handler_add (plugin, "KICK", <entry>pseudo sur le serveur courant</entry> </row> <row> + <entry><literal>%M</literal></entry> + <entry> + pseudos sur le serveur courant + (tous les canaux ouverts) + </entry> + </row> + <row> <entry><literal>%n</literal></entry> <entry>pseudos du canal courant</entry> </row> diff --git a/src/common/completion.c b/src/common/completion.c index 60ffa5e43..ec07d07ac 100644 --- a/src/common/completion.c +++ b/src/common/completion.c @@ -552,6 +552,58 @@ completion_list_add_self_nick (t_completion *completion) } /* + * completion_list_add_server_nicks: add server nicks to completion list + */ + +void +completion_list_add_server_nicks (t_completion *completion) +{ + t_irc_server *ptr_server; + t_irc_channel *ptr_channel; + t_irc_nick *ptr_nick; + + if (completion->server) + { + for (ptr_server = (t_irc_server *)(completion->server); ptr_server; + ptr_server = ptr_server->next_server) + { + for (ptr_channel = ptr_server->channels; ptr_channel; + ptr_channel = ptr_channel->next_channel) + { + if ((!completion->channel || (t_irc_channel *)(completion->channel) != ptr_channel) + && (ptr_channel->type == CHANNEL_TYPE_CHANNEL)) + { + for (ptr_nick = ptr_channel->nicks; ptr_nick; + ptr_nick = ptr_nick->next_nick) + { + completion_list_add (completion, ptr_nick->nick, + 1, WEELIST_POS_SORT); + } + } + } + } + + /* add self nick at the end */ + completion_list_add (completion, + ((t_irc_server *)(completion->server))->nick, + 1, WEELIST_POS_END); + + /* add current channel nicks at beginning */ + if (completion->channel && (((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_CHANNEL)) + { + for (ptr_nick = ((t_irc_channel *)(completion->channel))->nicks; + ptr_nick; ptr_nick = ptr_nick->next_nick) + { + completion_list_add (completion, ptr_nick->nick, + 1, WEELIST_POS_BEGINNING); + } + } + + completion->arg_is_nick = 1; + } +} + +/* * completion_list_add_channel_nicks: add channel nicks to completion list */ @@ -572,11 +624,13 @@ completion_list_add_channel_nicks (t_completion *completion) completion_list_add (completion, ptr_nick->nick, 1, WEELIST_POS_SORT); } + /* add self nick at the end */ if (completion->server) completion_list_add (completion, ((t_irc_server *)(completion->server))->nick, 1, WEELIST_POS_END); + /* add nicks speaking recently on this channel */ if (cfg_look_nick_completion_smart) { @@ -994,6 +1048,9 @@ completion_build_list_template (t_completion *completion, char *template) case 'm': /* self nickname */ completion_list_add_self_nick (completion); break; + case 'M': /* nicks of current server (all open channels) */ + completion_list_add_server_nicks (completion); + break; case 'n': /* channel nicks */ completion_list_add_channel_nicks (completion); completion->context = COMPLETION_NICK; diff --git a/weechat/ChangeLog b/weechat/ChangeLog index 603bc5c7f..0cbd5714a 100644 --- a/weechat/ChangeLog +++ b/weechat/ChangeLog @@ -5,6 +5,8 @@ ChangeLog - 2007-05-23 Version 0.2.5 (under dev!): + * added "%M" for completion with nicks of current server (nicks on open + channels) (task #6931) * improved key bindings: now possible to bind a key on many commands, separated by semicolon (task #5444) * improved IRC long message split: use word boundary (task #6685) diff --git a/weechat/doc/de/weechat.de.xml b/weechat/doc/de/weechat.de.xml index 305375b78..1d6a7b45c 100644 --- a/weechat/doc/de/weechat.de.xml +++ b/weechat/doc/de/weechat.de.xml @@ -2306,6 +2306,13 @@ msg_handler = plugin->msg_handler_add (plugin, "KICK", <entry>Nicknamen des gegenwärtigen Servers</entry> </row> <row> + <entry><literal>%M</literal></entry> + <!-- TRANSLATION NEEDED --> + <entry> + nicks on current server (on all open channels) + </entry> + </row> + <row> <entry><literal>%n</literal></entry> <entry>Nicknamen des gegenwärtigen Channels</entry> </row> diff --git a/weechat/doc/en/weechat.en.xml b/weechat/doc/en/weechat.en.xml index 9b36f89bc..aeeb9ad08 100644 --- a/weechat/doc/en/weechat.en.xml +++ b/weechat/doc/en/weechat.en.xml @@ -2321,6 +2321,12 @@ msg_handler = plugin->msg_handler_add (plugin, "KICK", <entry>nick on current server</entry> </row> <row> + <entry><literal>%M</literal></entry> + <entry> + nicks on current server (on all open channels) + </entry> + </row> + <row> <entry><literal>%n</literal></entry> <entry>nicks of current channel</entry> </row> diff --git a/weechat/doc/fr/weechat.fr.xml b/weechat/doc/fr/weechat.fr.xml index 1e4dbd56c..93111fadb 100644 --- a/weechat/doc/fr/weechat.fr.xml +++ b/weechat/doc/fr/weechat.fr.xml @@ -2378,6 +2378,13 @@ msg_handler = plugin->msg_handler_add (plugin, "KICK", <entry>pseudo sur le serveur courant</entry> </row> <row> + <entry><literal>%M</literal></entry> + <entry> + pseudos sur le serveur courant + (tous les canaux ouverts) + </entry> + </row> + <row> <entry><literal>%n</literal></entry> <entry>pseudos du canal courant</entry> </row> diff --git a/weechat/src/common/completion.c b/weechat/src/common/completion.c index 60ffa5e43..ec07d07ac 100644 --- a/weechat/src/common/completion.c +++ b/weechat/src/common/completion.c @@ -552,6 +552,58 @@ completion_list_add_self_nick (t_completion *completion) } /* + * completion_list_add_server_nicks: add server nicks to completion list + */ + +void +completion_list_add_server_nicks (t_completion *completion) +{ + t_irc_server *ptr_server; + t_irc_channel *ptr_channel; + t_irc_nick *ptr_nick; + + if (completion->server) + { + for (ptr_server = (t_irc_server *)(completion->server); ptr_server; + ptr_server = ptr_server->next_server) + { + for (ptr_channel = ptr_server->channels; ptr_channel; + ptr_channel = ptr_channel->next_channel) + { + if ((!completion->channel || (t_irc_channel *)(completion->channel) != ptr_channel) + && (ptr_channel->type == CHANNEL_TYPE_CHANNEL)) + { + for (ptr_nick = ptr_channel->nicks; ptr_nick; + ptr_nick = ptr_nick->next_nick) + { + completion_list_add (completion, ptr_nick->nick, + 1, WEELIST_POS_SORT); + } + } + } + } + + /* add self nick at the end */ + completion_list_add (completion, + ((t_irc_server *)(completion->server))->nick, + 1, WEELIST_POS_END); + + /* add current channel nicks at beginning */ + if (completion->channel && (((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_CHANNEL)) + { + for (ptr_nick = ((t_irc_channel *)(completion->channel))->nicks; + ptr_nick; ptr_nick = ptr_nick->next_nick) + { + completion_list_add (completion, ptr_nick->nick, + 1, WEELIST_POS_BEGINNING); + } + } + + completion->arg_is_nick = 1; + } +} + +/* * completion_list_add_channel_nicks: add channel nicks to completion list */ @@ -572,11 +624,13 @@ completion_list_add_channel_nicks (t_completion *completion) completion_list_add (completion, ptr_nick->nick, 1, WEELIST_POS_SORT); } + /* add self nick at the end */ if (completion->server) completion_list_add (completion, ((t_irc_server *)(completion->server))->nick, 1, WEELIST_POS_END); + /* add nicks speaking recently on this channel */ if (cfg_look_nick_completion_smart) { @@ -994,6 +1048,9 @@ completion_build_list_template (t_completion *completion, char *template) case 'm': /* self nickname */ completion_list_add_self_nick (completion); break; + case 'M': /* nicks of current server (all open channels) */ + completion_list_add_server_nicks (completion); + break; case 'n': /* channel nicks */ completion_list_add_channel_nicks (completion); completion->context = COMPLETION_NICK; |