mirror of
https://github.com/weechat/weechat.git
synced 2026-07-10 11:43:13 +02:00
core: rename functions hook_completion_{get_string|list_add} to completion_{get_string|list_add}
Old functions are kept for compatibility reasons.
This commit is contained in:
@@ -48,8 +48,8 @@ alias_completion_alias_cb (const void *pointer, void *data,
|
||||
for (ptr_alias = alias_list; ptr_alias;
|
||||
ptr_alias = ptr_alias->next_alias)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion, ptr_alias->name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, ptr_alias->name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
@@ -76,7 +76,7 @@ alias_completion_alias_value_cb (const void *pointer, void *data,
|
||||
(void) completion_item;
|
||||
(void) buffer;
|
||||
|
||||
args = weechat_hook_completion_get_string (completion, "args");
|
||||
args = weechat_completion_get_string (completion, "args");
|
||||
if (args)
|
||||
{
|
||||
argv = weechat_string_split (args, " ", NULL,
|
||||
@@ -96,10 +96,10 @@ alias_completion_alias_value_cb (const void *pointer, void *data,
|
||||
ptr_alias = alias_search (alias_name);
|
||||
if (ptr_alias)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion,
|
||||
ptr_alias->command,
|
||||
0,
|
||||
WEECHAT_LIST_POS_BEGINNING);
|
||||
weechat_completion_list_add (completion,
|
||||
ptr_alias->command,
|
||||
0,
|
||||
WEECHAT_LIST_POS_BEGINNING);
|
||||
}
|
||||
free (alias_name);
|
||||
}
|
||||
|
||||
@@ -51,12 +51,12 @@ exec_completion_commands_ids_cb (const void *pointer, void *data,
|
||||
{
|
||||
snprintf (str_number, sizeof (str_number),
|
||||
"%ld", ptr_exec_cmd->number);
|
||||
weechat_hook_completion_list_add (completion, str_number,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, str_number,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
if (ptr_exec_cmd->name)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion, ptr_exec_cmd->name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, ptr_exec_cmd->name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -62,19 +62,19 @@ fset_completion_option_cb (const void *pointer, void *data,
|
||||
{
|
||||
if (!config_section_added)
|
||||
{
|
||||
weechat_hook_completion_list_add (
|
||||
weechat_completion_list_add (
|
||||
completion,
|
||||
weechat_config_option_get_string (ptr_option,
|
||||
"config_name"),
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_hook_completion_list_add (
|
||||
weechat_completion_list_add (
|
||||
completion,
|
||||
weechat_config_option_get_string (ptr_option,
|
||||
"section_name"),
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
config_section_added = 1;
|
||||
}
|
||||
weechat_hook_completion_list_add (
|
||||
weechat_completion_list_add (
|
||||
completion,
|
||||
weechat_config_option_get_string (ptr_option, "name"),
|
||||
0,
|
||||
@@ -92,7 +92,7 @@ fset_completion_option_cb (const void *pointer, void *data,
|
||||
{
|
||||
for (i = 0; i < num_words; i++)
|
||||
{
|
||||
weechat_hook_completion_list_add (
|
||||
weechat_completion_list_add (
|
||||
completion, words[i], 0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2057,6 +2057,11 @@ weechat_guile_api_hook_completion (SCM completion, SCM description,
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function deprecated since WeeChat 2.9, kept for compatibility.
|
||||
* It is replaced by completion_get_string.
|
||||
*/
|
||||
|
||||
SCM
|
||||
weechat_guile_api_hook_completion_get_string (SCM completion, SCM property)
|
||||
{
|
||||
@@ -2074,6 +2079,11 @@ weechat_guile_api_hook_completion_get_string (SCM completion, SCM property)
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function deprecated since WeeChat 2.9, kept for compatibility.
|
||||
* It is replaced by completion_list_add.
|
||||
*/
|
||||
|
||||
SCM
|
||||
weechat_guile_api_hook_completion_list_add (SCM completion, SCM word,
|
||||
SCM nick_completion, SCM where)
|
||||
@@ -4137,6 +4147,40 @@ weechat_guile_api_completion_search (SCM completion, SCM data, SCM position,
|
||||
API_RETURN_INT(rc);
|
||||
}
|
||||
|
||||
SCM
|
||||
weechat_guile_api_completion_get_string (SCM completion, SCM property)
|
||||
{
|
||||
const char *result;
|
||||
SCM return_value;
|
||||
|
||||
API_INIT_FUNC(1, "completion_get_string", API_RETURN_EMPTY);
|
||||
if (!scm_is_string (completion) || !scm_is_string (property))
|
||||
API_WRONG_ARGS(API_RETURN_EMPTY);
|
||||
|
||||
result = weechat_completion_get_string (
|
||||
API_STR2PTR(API_SCM_TO_STRING(completion)),
|
||||
API_SCM_TO_STRING(property));
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
SCM
|
||||
weechat_guile_api_completion_list_add (SCM completion, SCM word,
|
||||
SCM nick_completion, SCM where)
|
||||
{
|
||||
API_INIT_FUNC(1, "completion_list_add", API_RETURN_ERROR);
|
||||
if (!scm_is_string (completion) || !scm_is_string (word)
|
||||
|| !scm_is_integer (nick_completion) || !scm_is_string (where))
|
||||
API_WRONG_ARGS(API_RETURN_ERROR);
|
||||
|
||||
weechat_completion_list_add (API_STR2PTR(API_SCM_TO_STRING(completion)),
|
||||
API_SCM_TO_STRING(word),
|
||||
scm_to_int (nick_completion),
|
||||
API_SCM_TO_STRING(where));
|
||||
|
||||
API_RETURN_OK;
|
||||
}
|
||||
|
||||
SCM
|
||||
weechat_guile_api_completion_free (SCM completion)
|
||||
{
|
||||
@@ -5103,6 +5147,8 @@ weechat_guile_api_module_init (void *data)
|
||||
API_DEF_FUNC(command_options, 3);
|
||||
API_DEF_FUNC(completion_new, 1);
|
||||
API_DEF_FUNC(completion_search, 4);
|
||||
API_DEF_FUNC(completion_get_string, 2);
|
||||
API_DEF_FUNC(completion_list_add, 4);
|
||||
API_DEF_FUNC(completion_free, 1);
|
||||
API_DEF_FUNC(info_get, 2);
|
||||
API_DEF_FUNC(info_get_hashtable, 2);
|
||||
|
||||
@@ -56,8 +56,8 @@ irc_completion_server_cb (const void *pointer, void *data,
|
||||
|
||||
if (ptr_server)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion, ptr_server->name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, ptr_server->name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
@@ -82,8 +82,8 @@ irc_completion_server_nick_cb (const void *pointer, void *data,
|
||||
|
||||
if (ptr_server && ptr_server->nick)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion, ptr_server->nick,
|
||||
1, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, ptr_server->nick,
|
||||
1, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
@@ -115,16 +115,16 @@ irc_completion_server_channels_cb (const void *pointer, void *data,
|
||||
{
|
||||
if (ptr_channel2->type == IRC_CHANNEL_TYPE_CHANNEL)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion, ptr_channel2->name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, ptr_channel2->name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
}
|
||||
|
||||
/* add current channel first in list */
|
||||
if (ptr_channel)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion, ptr_channel->name,
|
||||
0, WEECHAT_LIST_POS_BEGINNING);
|
||||
weechat_completion_list_add (completion, ptr_channel->name,
|
||||
0, WEECHAT_LIST_POS_BEGINNING);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,8 +157,8 @@ irc_completion_server_privates_cb (const void *pointer, void *data,
|
||||
{
|
||||
if (ptr_channel->type == IRC_CHANNEL_TYPE_PRIVATE)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion, ptr_channel->name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, ptr_channel->name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -196,15 +196,15 @@ irc_completion_server_nicks_cb (const void *pointer, void *data,
|
||||
for (ptr_nick = ptr_channel2->nicks; ptr_nick;
|
||||
ptr_nick = ptr_nick->next_nick)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion, ptr_nick->name,
|
||||
1, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, ptr_nick->name,
|
||||
1, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* add self nick at the end */
|
||||
weechat_hook_completion_list_add (completion, ptr_server->nick,
|
||||
1, WEECHAT_LIST_POS_END);
|
||||
weechat_completion_list_add (completion, ptr_server->nick,
|
||||
1, WEECHAT_LIST_POS_END);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
@@ -231,8 +231,8 @@ irc_completion_servers_cb (const void *pointer, void *data,
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion, ptr_server->name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, ptr_server->name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
@@ -257,8 +257,8 @@ irc_completion_channel_cb (const void *pointer, void *data,
|
||||
|
||||
if (ptr_channel)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion, ptr_channel->name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, ptr_channel->name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
@@ -286,10 +286,10 @@ irc_completion_channel_nicks_add_speakers (struct t_gui_completion *completion,
|
||||
weechat_list_get (channel->nicks_speaking[highlight], i));
|
||||
if (nick && irc_nick_search (server, channel, nick))
|
||||
{
|
||||
weechat_hook_completion_list_add (completion,
|
||||
nick,
|
||||
1,
|
||||
WEECHAT_LIST_POS_BEGINNING);
|
||||
weechat_completion_list_add (completion,
|
||||
nick,
|
||||
1,
|
||||
WEECHAT_LIST_POS_BEGINNING);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -322,10 +322,10 @@ irc_completion_channel_nicks_cb (const void *pointer, void *data,
|
||||
for (ptr_nick = ptr_channel->nicks; ptr_nick;
|
||||
ptr_nick = ptr_nick->next_nick)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion,
|
||||
ptr_nick->name,
|
||||
1,
|
||||
WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion,
|
||||
ptr_nick->name,
|
||||
1,
|
||||
WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
/* add recent speakers on channel */
|
||||
if (weechat_config_integer (irc_config_look_nick_completion_smart) == IRC_CONFIG_NICK_COMPLETION_SMART_SPEAKERS)
|
||||
@@ -338,22 +338,22 @@ irc_completion_channel_nicks_cb (const void *pointer, void *data,
|
||||
irc_completion_channel_nicks_add_speakers (completion, ptr_server, ptr_channel, 1);
|
||||
}
|
||||
/* add self nick at the end */
|
||||
weechat_hook_completion_list_add (completion,
|
||||
ptr_server->nick,
|
||||
1,
|
||||
WEECHAT_LIST_POS_END);
|
||||
weechat_completion_list_add (completion,
|
||||
ptr_server->nick,
|
||||
1,
|
||||
WEECHAT_LIST_POS_END);
|
||||
break;
|
||||
case IRC_CHANNEL_TYPE_PRIVATE:
|
||||
/* remote nick */
|
||||
weechat_hook_completion_list_add (completion,
|
||||
ptr_channel->name,
|
||||
1,
|
||||
WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion,
|
||||
ptr_channel->name,
|
||||
1,
|
||||
WEECHAT_LIST_POS_SORT);
|
||||
/* add self nick at the end */
|
||||
weechat_hook_completion_list_add (completion,
|
||||
ptr_server->nick,
|
||||
1,
|
||||
WEECHAT_LIST_POS_END);
|
||||
weechat_completion_list_add (completion,
|
||||
ptr_server->nick,
|
||||
1,
|
||||
WEECHAT_LIST_POS_END);
|
||||
break;
|
||||
}
|
||||
ptr_channel->nick_completion_reset = 0;
|
||||
@@ -391,10 +391,10 @@ irc_completion_channel_nicks_hosts_cb (const void *pointer, void *data,
|
||||
for (ptr_nick = ptr_channel->nicks; ptr_nick;
|
||||
ptr_nick = ptr_nick->next_nick)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion,
|
||||
ptr_nick->name,
|
||||
1,
|
||||
WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion,
|
||||
ptr_nick->name,
|
||||
1,
|
||||
WEECHAT_LIST_POS_SORT);
|
||||
if (ptr_nick->host)
|
||||
{
|
||||
length = strlen (ptr_nick->name) + 1 +
|
||||
@@ -404,7 +404,7 @@ irc_completion_channel_nicks_hosts_cb (const void *pointer, void *data,
|
||||
{
|
||||
snprintf (buf, length, "%s!%s",
|
||||
ptr_nick->name, ptr_nick->host);
|
||||
weechat_hook_completion_list_add (
|
||||
weechat_completion_list_add (
|
||||
completion, buf, 0, WEECHAT_LIST_POS_SORT);
|
||||
free (buf);
|
||||
}
|
||||
@@ -412,7 +412,7 @@ irc_completion_channel_nicks_hosts_cb (const void *pointer, void *data,
|
||||
}
|
||||
break;
|
||||
case IRC_CHANNEL_TYPE_PRIVATE:
|
||||
weechat_hook_completion_list_add (
|
||||
weechat_completion_list_add (
|
||||
completion, ptr_channel->name, 1, WEECHAT_LIST_POS_SORT);
|
||||
break;
|
||||
}
|
||||
@@ -453,9 +453,9 @@ irc_completion_modelist_masks_cb (const void *pointer, void *data,
|
||||
for (ptr_item = ptr_modelist->items; ptr_item;
|
||||
ptr_item = ptr_item->next_item)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion,
|
||||
ptr_item->mask,
|
||||
0, WEECHAT_LIST_POS_END);
|
||||
weechat_completion_list_add (completion,
|
||||
ptr_item->mask,
|
||||
0, WEECHAT_LIST_POS_END);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -497,9 +497,9 @@ irc_completion_modelist_numbers_cb (const void *pointer, void *data,
|
||||
{
|
||||
snprintf (str_number, sizeof (str_number),
|
||||
"%d", ptr_item->number + 1);
|
||||
weechat_hook_completion_list_add (completion,
|
||||
str_number,
|
||||
0, WEECHAT_LIST_POS_END);
|
||||
weechat_completion_list_add (completion,
|
||||
str_number,
|
||||
0, WEECHAT_LIST_POS_END);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -551,9 +551,9 @@ irc_completion_channel_topic_cb (const void *pointer, void *data,
|
||||
else
|
||||
topic = strdup (ptr_channel->topic);
|
||||
|
||||
weechat_hook_completion_list_add (completion,
|
||||
(topic) ? topic : ptr_channel->topic,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion,
|
||||
(topic) ? topic : ptr_channel->topic,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
if (topic)
|
||||
free (topic);
|
||||
}
|
||||
@@ -603,10 +603,10 @@ irc_completion_channels_cb (const void *pointer, void *data,
|
||||
}
|
||||
else
|
||||
{
|
||||
weechat_hook_completion_list_add (completion,
|
||||
ptr_channel2->name,
|
||||
0,
|
||||
WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion,
|
||||
ptr_channel2->name,
|
||||
0,
|
||||
WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -615,7 +615,7 @@ irc_completion_channels_cb (const void *pointer, void *data,
|
||||
/* add channels of current server first in list */
|
||||
for (i = weechat_list_size (channels_current_server) - 1; i >= 0; i--)
|
||||
{
|
||||
weechat_hook_completion_list_add (
|
||||
weechat_completion_list_add (
|
||||
completion,
|
||||
weechat_list_string (
|
||||
weechat_list_get (channels_current_server, i)),
|
||||
@@ -627,8 +627,8 @@ irc_completion_channels_cb (const void *pointer, void *data,
|
||||
/* add current channel first in list */
|
||||
if (ptr_channel)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion, ptr_channel->name,
|
||||
0, WEECHAT_LIST_POS_BEGINNING);
|
||||
weechat_completion_list_add (completion, ptr_channel->name,
|
||||
0, WEECHAT_LIST_POS_BEGINNING);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
@@ -661,8 +661,8 @@ irc_completion_privates_cb (const void *pointer, void *data,
|
||||
{
|
||||
if (ptr_channel->type == IRC_CHANNEL_TYPE_PRIVATE)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion, ptr_channel->name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, ptr_channel->name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -695,8 +695,8 @@ irc_completion_msg_kick_cb (const void *pointer, void *data,
|
||||
IRC_SERVER_OPTION_MSG_KICK);
|
||||
if (msg_kick && msg_kick[0])
|
||||
{
|
||||
weechat_hook_completion_list_add (completion, msg_kick,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, msg_kick,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -728,8 +728,8 @@ irc_completion_msg_part_cb (const void *pointer, void *data,
|
||||
IRC_SERVER_OPTION_MSG_PART);
|
||||
if (msg_part && msg_part[0])
|
||||
{
|
||||
weechat_hook_completion_list_add (completion, msg_part,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, msg_part,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -759,8 +759,8 @@ irc_completion_ignores_numbers_cb (const void *pointer, void *data,
|
||||
ptr_ignore = ptr_ignore->next_ignore)
|
||||
{
|
||||
snprintf (str_number, sizeof (str_number), "%d", ptr_ignore->number);
|
||||
weechat_hook_completion_list_add (completion, str_number,
|
||||
0, WEECHAT_LIST_POS_END);
|
||||
weechat_completion_list_add (completion, str_number,
|
||||
0, WEECHAT_LIST_POS_END);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
@@ -790,8 +790,8 @@ irc_completion_notify_nicks_cb (const void *pointer, void *data,
|
||||
for (ptr_notify = ptr_server->notify_list; ptr_notify;
|
||||
ptr_notify = ptr_notify->next_notify)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion, ptr_notify->nick,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, ptr_notify->nick,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -802,8 +802,8 @@ irc_completion_notify_nicks_cb (const void *pointer, void *data,
|
||||
for (ptr_notify = ptr_server->notify_list; ptr_notify;
|
||||
ptr_notify = ptr_notify->next_notify)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion, ptr_notify->nick,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, ptr_notify->nick,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -831,37 +831,37 @@ irc_completion_raw_filters_cb (const void *pointer, void *data,
|
||||
(void) completion_item;
|
||||
|
||||
/* all messages */
|
||||
weechat_hook_completion_list_add (completion, "*",
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, "*",
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
|
||||
/* condition */
|
||||
weechat_hook_completion_list_add (completion,
|
||||
"c:${recv} && ${command}==PRIVMSG",
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion,
|
||||
"c:${recv} && ${command}==PRIVMSG",
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
|
||||
/* message flag */
|
||||
weechat_hook_completion_list_add (completion, "f:modified",
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_hook_completion_list_add (completion, "f:recv",
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_hook_completion_list_add (completion, "f:redirected",
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_hook_completion_list_add (completion, "f:sent",
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, "f:modified",
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, "f:recv",
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, "f:redirected",
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, "f:sent",
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
|
||||
/* IRC command */
|
||||
weechat_hook_completion_list_add (completion, "m:notice",
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_hook_completion_list_add (completion, "m:privmsg",
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, "m:notice",
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, "m:privmsg",
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
|
||||
/* server */
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
snprintf (str_filter, sizeof (str_filter), "s:%s", ptr_server->name);
|
||||
weechat_hook_completion_list_add (completion, str_filter,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, str_filter,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
|
||||
@@ -1948,6 +1948,11 @@ API_FUNC(hook_completion)
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function deprecated since WeeChat 2.9, kept for compatibility.
|
||||
* It is replaced by completion_get_string.
|
||||
*/
|
||||
|
||||
API_FUNC(hook_completion_get_string)
|
||||
{
|
||||
const char *result;
|
||||
@@ -1964,6 +1969,11 @@ API_FUNC(hook_completion_get_string)
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function deprecated since WeeChat 2.9, kept for compatibility.
|
||||
* It is replaced by completion_list_add.
|
||||
*/
|
||||
|
||||
API_FUNC(hook_completion_list_add)
|
||||
{
|
||||
int nick_completion;
|
||||
@@ -4033,6 +4043,42 @@ API_FUNC(completion_search)
|
||||
API_RETURN_INT(rc);
|
||||
}
|
||||
|
||||
API_FUNC(completion_get_string)
|
||||
{
|
||||
const char *result;
|
||||
|
||||
API_INIT_FUNC(1, "completion_get_string", "ss", API_RETURN_EMPTY);
|
||||
|
||||
v8::String::Utf8Value completion(args[0]);
|
||||
v8::String::Utf8Value property(args[1]);
|
||||
|
||||
result = weechat_completion_get_string (
|
||||
(struct t_gui_completion *)API_STR2PTR(*completion),
|
||||
*property);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
API_FUNC(completion_list_add)
|
||||
{
|
||||
int nick_completion;
|
||||
|
||||
API_INIT_FUNC(1, "completion_list_add", "ssis", API_RETURN_ERROR);
|
||||
|
||||
v8::String::Utf8Value completion(args[0]);
|
||||
v8::String::Utf8Value word(args[1]);
|
||||
nick_completion = args[2]->IntegerValue();
|
||||
v8::String::Utf8Value where(args[3]);
|
||||
|
||||
weechat_completion_list_add (
|
||||
(struct t_gui_completion *)API_STR2PTR(*completion),
|
||||
*word,
|
||||
nick_completion,
|
||||
*where);
|
||||
|
||||
API_RETURN_OK;
|
||||
}
|
||||
|
||||
API_FUNC(completion_free)
|
||||
{
|
||||
API_INIT_FUNC(1, "completion_free", "s", API_RETURN_ERROR);
|
||||
@@ -5038,6 +5084,8 @@ WeechatJsV8::loadLibs()
|
||||
API_DEF_FUNC(command_options);
|
||||
API_DEF_FUNC(completion_new);
|
||||
API_DEF_FUNC(completion_search);
|
||||
API_DEF_FUNC(completion_get_string);
|
||||
API_DEF_FUNC(completion_list_add);
|
||||
API_DEF_FUNC(completion_free);
|
||||
API_DEF_FUNC(info_get);
|
||||
API_DEF_FUNC(info_get_hashtable);
|
||||
|
||||
@@ -2165,6 +2165,11 @@ API_FUNC(hook_completion)
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function deprecated since WeeChat 2.9, kept for compatibility.
|
||||
* It is replaced by completion_get_string.
|
||||
*/
|
||||
|
||||
API_FUNC(hook_completion_get_string)
|
||||
{
|
||||
const char *completion, *property, *result;
|
||||
@@ -2182,6 +2187,11 @@ API_FUNC(hook_completion_get_string)
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function deprecated since WeeChat 2.9, kept for compatibility.
|
||||
* It is replaced by completion_list_add.
|
||||
*/
|
||||
|
||||
API_FUNC(hook_completion_list_add)
|
||||
{
|
||||
const char *completion, *word, *where;
|
||||
@@ -4373,6 +4383,45 @@ API_FUNC(completion_search)
|
||||
API_RETURN_INT(rc);
|
||||
}
|
||||
|
||||
API_FUNC(completion_get_string)
|
||||
{
|
||||
const char *completion, *property, *result;
|
||||
|
||||
API_INIT_FUNC(1, "completion_get_string", API_RETURN_EMPTY);
|
||||
if (lua_gettop (L) < 2)
|
||||
API_WRONG_ARGS(API_RETURN_EMPTY);
|
||||
|
||||
completion = lua_tostring (L, -2);
|
||||
property = lua_tostring (L, -1);
|
||||
|
||||
result = weechat_completion_get_string (API_STR2PTR(completion),
|
||||
property);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
API_FUNC(completion_list_add)
|
||||
{
|
||||
const char *completion, *word, *where;
|
||||
int nick_completion;
|
||||
|
||||
API_INIT_FUNC(1, "completion_list_add", API_RETURN_ERROR);
|
||||
if (lua_gettop (L) < 4)
|
||||
API_WRONG_ARGS(API_RETURN_ERROR);
|
||||
|
||||
completion = lua_tostring (L, -4);
|
||||
word = lua_tostring (L, -3);
|
||||
nick_completion = lua_tonumber (L, -2);
|
||||
where = lua_tostring (L, -1);
|
||||
|
||||
weechat_completion_list_add (API_STR2PTR(completion),
|
||||
word,
|
||||
nick_completion,
|
||||
where);
|
||||
|
||||
API_RETURN_OK;
|
||||
}
|
||||
|
||||
API_FUNC(completion_free)
|
||||
{
|
||||
const char *completion;
|
||||
@@ -5398,6 +5447,8 @@ const struct luaL_Reg weechat_lua_api_funcs[] = {
|
||||
API_DEF_FUNC(command_options),
|
||||
API_DEF_FUNC(completion_new),
|
||||
API_DEF_FUNC(completion_search),
|
||||
API_DEF_FUNC(completion_get_string),
|
||||
API_DEF_FUNC(completion_list_add),
|
||||
API_DEF_FUNC(completion_free),
|
||||
API_DEF_FUNC(info_get),
|
||||
API_DEF_FUNC(info_get_hashtable),
|
||||
|
||||
@@ -2081,6 +2081,11 @@ API_FUNC(hook_completion)
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function deprecated since WeeChat 2.9, kept for compatibility.
|
||||
* It is replaced by completion_get_string.
|
||||
*/
|
||||
|
||||
API_FUNC(hook_completion_get_string)
|
||||
{
|
||||
char *completion, *property;
|
||||
@@ -2100,6 +2105,11 @@ API_FUNC(hook_completion_get_string)
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function deprecated since WeeChat 2.9, kept for compatibility.
|
||||
* It is replaced by completion_list_add.
|
||||
*/
|
||||
|
||||
API_FUNC(hook_completion_list_add)
|
||||
{
|
||||
char *completion, *word, *where;
|
||||
@@ -4296,6 +4306,46 @@ API_FUNC(completion_search)
|
||||
API_RETURN_INT(rc);
|
||||
}
|
||||
|
||||
API_FUNC(completion_get_string)
|
||||
{
|
||||
char *completion, *property;
|
||||
const char *result;
|
||||
dXSARGS;
|
||||
|
||||
API_INIT_FUNC(1, "completion_get_string", API_RETURN_EMPTY);
|
||||
if (items < 2)
|
||||
API_WRONG_ARGS(API_RETURN_EMPTY);
|
||||
|
||||
completion = SvPV_nolen (ST (0));
|
||||
property = SvPV_nolen (ST (1));
|
||||
|
||||
result = weechat_completion_get_string (API_STR2PTR(completion),
|
||||
property);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
API_FUNC(completion_list_add)
|
||||
{
|
||||
char *completion, *word, *where;
|
||||
dXSARGS;
|
||||
|
||||
API_INIT_FUNC(1, "completion_list_add", API_RETURN_ERROR);
|
||||
if (items < 4)
|
||||
API_WRONG_ARGS(API_RETURN_ERROR);
|
||||
|
||||
completion = SvPV_nolen (ST (0));
|
||||
word = SvPV_nolen (ST (1));
|
||||
where = SvPV_nolen (ST (3));
|
||||
|
||||
weechat_completion_list_add (API_STR2PTR(completion),
|
||||
word,
|
||||
SvIV (ST (2)), /* nick_completion */
|
||||
where);
|
||||
|
||||
API_RETURN_OK;
|
||||
}
|
||||
|
||||
API_FUNC(completion_free)
|
||||
{
|
||||
dXSARGS;
|
||||
@@ -5355,6 +5405,8 @@ weechat_perl_api_init (pTHX)
|
||||
API_DEF_FUNC(command_options);
|
||||
API_DEF_FUNC(completion_new);
|
||||
API_DEF_FUNC(completion_search);
|
||||
API_DEF_FUNC(completion_get_string);
|
||||
API_DEF_FUNC(completion_list_add);
|
||||
API_DEF_FUNC(completion_free);
|
||||
API_DEF_FUNC(info_get);
|
||||
API_DEF_FUNC(info_get_hashtable);
|
||||
|
||||
@@ -2206,6 +2206,11 @@ API_FUNC(hook_completion)
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function deprecated since WeeChat 2.9, kept for compatibility.
|
||||
* It is replaced by completion_get_string.
|
||||
*/
|
||||
|
||||
API_FUNC(hook_completion_get_string)
|
||||
{
|
||||
zend_string *z_completion, *z_property;
|
||||
@@ -2227,6 +2232,11 @@ API_FUNC(hook_completion_get_string)
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function deprecated since WeeChat 2.9, kept for compatibility.
|
||||
* It is replaced by completion_list_add.
|
||||
*/
|
||||
|
||||
API_FUNC(hook_completion_list_add)
|
||||
{
|
||||
zend_string *z_completion, *z_word, *z_where;
|
||||
@@ -4308,6 +4318,53 @@ API_FUNC(completion_search)
|
||||
API_RETURN_INT(rc);
|
||||
}
|
||||
|
||||
API_FUNC(completion_get_string)
|
||||
{
|
||||
zend_string *z_completion, *z_property;
|
||||
struct t_gui_completion *completion;
|
||||
char *property;
|
||||
const char *result;
|
||||
|
||||
API_INIT_FUNC(1, "completion_get_string", API_RETURN_EMPTY);
|
||||
if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_completion,
|
||||
&z_property) == FAILURE)
|
||||
API_WRONG_ARGS(API_RETURN_EMPTY);
|
||||
|
||||
completion = (struct t_gui_completion *)API_STR2PTR(ZSTR_VAL(z_completion));
|
||||
property = ZSTR_VAL(z_property);
|
||||
|
||||
result = weechat_completion_get_string (completion,
|
||||
(const char *)property);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
API_FUNC(completion_list_add)
|
||||
{
|
||||
zend_string *z_completion, *z_word, *z_where;
|
||||
zend_long z_nick_completion;
|
||||
struct t_gui_completion *completion;
|
||||
char *word, *where;
|
||||
int nick_completion;
|
||||
|
||||
API_INIT_FUNC(1, "completion_list_add", API_RETURN_ERROR);
|
||||
if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSlS", &z_completion,
|
||||
&z_word, &z_nick_completion, &z_where) == FAILURE)
|
||||
API_WRONG_ARGS(API_RETURN_ERROR);
|
||||
|
||||
completion = (struct t_gui_completion *)API_STR2PTR(ZSTR_VAL(z_completion));
|
||||
word = ZSTR_VAL(z_word);
|
||||
nick_completion = (int)z_nick_completion;
|
||||
where = ZSTR_VAL(z_where);
|
||||
|
||||
weechat_completion_list_add (completion,
|
||||
(const char *)word,
|
||||
nick_completion,
|
||||
(const char *)where);
|
||||
|
||||
API_RETURN_OK;
|
||||
}
|
||||
|
||||
API_FUNC(completion_free)
|
||||
{
|
||||
zend_string *z_completion;
|
||||
|
||||
@@ -200,6 +200,8 @@ PHP_FUNCTION(weechat_command);
|
||||
PHP_FUNCTION(weechat_command_options);
|
||||
PHP_FUNCTION(weechat_completion_new);
|
||||
PHP_FUNCTION(weechat_completion_search);
|
||||
PHP_FUNCTION(weechat_completion_get_string);
|
||||
PHP_FUNCTION(weechat_completion_list_add);
|
||||
PHP_FUNCTION(weechat_completion_free);
|
||||
PHP_FUNCTION(weechat_info_get);
|
||||
PHP_FUNCTION(weechat_info_get_hashtable);
|
||||
|
||||
@@ -253,6 +253,8 @@ const zend_function_entry weechat_functions[] = {
|
||||
PHP_FE(weechat_command_options, NULL)
|
||||
PHP_FE(weechat_completion_new, NULL)
|
||||
PHP_FE(weechat_completion_search, NULL)
|
||||
PHP_FE(weechat_completion_get_string, NULL)
|
||||
PHP_FE(weechat_completion_list_add, NULL)
|
||||
PHP_FE(weechat_completion_free, NULL)
|
||||
PHP_FE(weechat_info_get, NULL)
|
||||
PHP_FE(weechat_info_get_hashtable, NULL)
|
||||
|
||||
@@ -1087,8 +1087,8 @@ plugin_script_completion (struct t_weechat_plugin *weechat_plugin,
|
||||
for (ptr_script = scripts; ptr_script;
|
||||
ptr_script = ptr_script->next_script)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion, ptr_script->name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, ptr_script->name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -786,8 +786,8 @@ plugin_load (const char *filename, int init_plugin, int argc, char **argv)
|
||||
new_plugin->hook_hsignal_send = &hook_hsignal_send;
|
||||
new_plugin->hook_config = &hook_config;
|
||||
new_plugin->hook_completion = &hook_completion;
|
||||
new_plugin->hook_completion_get_string = &hook_completion_get_string;
|
||||
new_plugin->hook_completion_list_add = &hook_completion_list_add;
|
||||
new_plugin->hook_completion_get_string = &gui_completion_get_string;
|
||||
new_plugin->hook_completion_list_add = &gui_completion_list_add;
|
||||
new_plugin->hook_modifier = &hook_modifier;
|
||||
new_plugin->hook_modifier_exec = &hook_modifier_exec;
|
||||
new_plugin->hook_info = &hook_info;
|
||||
@@ -852,6 +852,8 @@ plugin_load (const char *filename, int init_plugin, int argc, char **argv)
|
||||
|
||||
new_plugin->completion_new = &gui_completion_new;
|
||||
new_plugin->completion_search = &gui_completion_search;
|
||||
new_plugin->completion_get_string = &gui_completion_get_string;
|
||||
new_plugin->completion_list_add = &gui_completion_list_add;
|
||||
new_plugin->completion_free = &gui_completion_free;
|
||||
|
||||
new_plugin->network_pass_proxy = &network_pass_proxy;
|
||||
|
||||
@@ -2071,6 +2071,11 @@ API_FUNC(hook_completion)
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function deprecated since WeeChat 2.9, kept for compatibility.
|
||||
* It is replaced by completion_get_string.
|
||||
*/
|
||||
|
||||
API_FUNC(hook_completion_get_string)
|
||||
{
|
||||
char *completion, *property;
|
||||
@@ -2088,6 +2093,11 @@ API_FUNC(hook_completion_get_string)
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function deprecated since WeeChat 2.9, kept for compatibility.
|
||||
* It is replaced by completion_list_add.
|
||||
*/
|
||||
|
||||
API_FUNC(hook_completion_list_add)
|
||||
{
|
||||
char *completion, *word, *where;
|
||||
@@ -4308,6 +4318,45 @@ API_FUNC(completion_search)
|
||||
API_RETURN_INT(rc);
|
||||
}
|
||||
|
||||
API_FUNC(completion_get_string)
|
||||
{
|
||||
char *completion, *property;
|
||||
const char *result;
|
||||
|
||||
API_INIT_FUNC(1, "completion_get_string", API_RETURN_EMPTY);
|
||||
completion = NULL;
|
||||
property = NULL;
|
||||
if (!PyArg_ParseTuple (args, "ss", &completion, &property))
|
||||
API_WRONG_ARGS(API_RETURN_EMPTY);
|
||||
|
||||
result = weechat_completion_get_string (API_STR2PTR(completion),
|
||||
property);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
API_FUNC(completion_list_add)
|
||||
{
|
||||
char *completion, *word, *where;
|
||||
int nick_completion;
|
||||
|
||||
API_INIT_FUNC(1, "completion_list_add", API_RETURN_ERROR);
|
||||
completion = NULL;
|
||||
word = NULL;
|
||||
nick_completion = 0;
|
||||
where = NULL;
|
||||
if (!PyArg_ParseTuple (args, "ssis", &completion, &word, &nick_completion,
|
||||
&where))
|
||||
API_WRONG_ARGS(API_RETURN_ERROR);
|
||||
|
||||
weechat_completion_list_add (API_STR2PTR(completion),
|
||||
word,
|
||||
nick_completion,
|
||||
where);
|
||||
|
||||
API_RETURN_OK;
|
||||
}
|
||||
|
||||
API_FUNC(completion_free)
|
||||
{
|
||||
char *completion;
|
||||
@@ -5305,6 +5354,8 @@ PyMethodDef weechat_python_funcs[] =
|
||||
API_DEF_FUNC(command_options),
|
||||
API_DEF_FUNC(completion_new),
|
||||
API_DEF_FUNC(completion_search),
|
||||
API_DEF_FUNC(completion_get_string),
|
||||
API_DEF_FUNC(completion_list_add),
|
||||
API_DEF_FUNC(completion_free),
|
||||
API_DEF_FUNC(info_get),
|
||||
API_DEF_FUNC(info_get_hashtable),
|
||||
|
||||
@@ -55,36 +55,36 @@ relay_completion_protocol_name_cb (const void *pointer, void *data,
|
||||
/* TCP socket */
|
||||
snprintf (protocol_name, sizeof (protocol_name), "irc.%s",
|
||||
weechat_infolist_string (infolist, "name"));
|
||||
weechat_hook_completion_list_add (completion, protocol_name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, protocol_name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
snprintf (protocol_name, sizeof (protocol_name), "ssl.irc.%s",
|
||||
weechat_infolist_string (infolist, "name"));
|
||||
weechat_hook_completion_list_add (completion, protocol_name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, protocol_name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
/* UNIX domain socket */
|
||||
snprintf (protocol_name, sizeof (protocol_name), "unix.irc.%s",
|
||||
weechat_infolist_string (infolist, "name"));
|
||||
weechat_hook_completion_list_add (completion, protocol_name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, protocol_name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
snprintf (protocol_name, sizeof (protocol_name), "unix.ssl.irc.%s",
|
||||
weechat_infolist_string (infolist, "name"));
|
||||
weechat_hook_completion_list_add (completion, protocol_name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, protocol_name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
weechat_infolist_free (infolist);
|
||||
}
|
||||
|
||||
/* TCP socket */
|
||||
weechat_hook_completion_list_add (completion, "weechat",
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_hook_completion_list_add (completion, "ssl.weechat",
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, "weechat",
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, "ssl.weechat",
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
|
||||
/* UNIX domain socket */
|
||||
weechat_hook_completion_list_add (completion, "unix.weechat",
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_hook_completion_list_add (completion, "unix.ssl.weechat",
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, "unix.weechat",
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, "unix.ssl.weechat",
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
@@ -110,9 +110,9 @@ relay_completion_relays_cb (const void *pointer, void *data,
|
||||
for (ptr_server = relay_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion,
|
||||
ptr_server->protocol_string,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion,
|
||||
ptr_server->protocol_string,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
@@ -149,8 +149,8 @@ relay_completion_free_port_cb (const void *pointer, void *data,
|
||||
port_max = 8000 - 1;
|
||||
|
||||
snprintf (str_port, sizeof (str_port), "%d", port_max + 1);
|
||||
weechat_hook_completion_list_add (completion, str_port,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, str_port,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
@@ -2550,6 +2550,11 @@ weechat_ruby_api_hook_completion (VALUE class, VALUE completion,
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function deprecated since WeeChat 2.9, kept for compatibility.
|
||||
* It is replaced by completion_get_string.
|
||||
*/
|
||||
|
||||
static VALUE
|
||||
weechat_ruby_api_hook_completion_get_string (VALUE class, VALUE completion,
|
||||
VALUE property)
|
||||
@@ -2573,6 +2578,11 @@ weechat_ruby_api_hook_completion_get_string (VALUE class, VALUE completion,
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function deprecated since WeeChat 2.9, kept for compatibility.
|
||||
* It is replaced by completion_list_add.
|
||||
*/
|
||||
|
||||
static VALUE
|
||||
weechat_ruby_api_hook_completion_list_add (VALUE class, VALUE completion,
|
||||
VALUE word, VALUE nick_completion,
|
||||
@@ -5197,6 +5207,60 @@ weechat_ruby_api_completion_search (VALUE class, VALUE completion, VALUE data,
|
||||
API_RETURN_INT(rc);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
weechat_ruby_api_completion_get_string (VALUE class, VALUE completion,
|
||||
VALUE property)
|
||||
{
|
||||
char *c_completion, *c_property;
|
||||
const char *result;
|
||||
|
||||
API_INIT_FUNC(1, "completion_get_string", API_RETURN_EMPTY);
|
||||
if (NIL_P (completion) || NIL_P (property))
|
||||
API_WRONG_ARGS(API_RETURN_EMPTY);
|
||||
|
||||
Check_Type (completion, T_STRING);
|
||||
Check_Type (property, T_STRING);
|
||||
|
||||
c_completion = StringValuePtr (completion);
|
||||
c_property = StringValuePtr (property);
|
||||
|
||||
result = weechat_completion_get_string (API_STR2PTR(c_completion),
|
||||
c_property);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
weechat_ruby_api_completion_list_add (VALUE class, VALUE completion,
|
||||
VALUE word, VALUE nick_completion,
|
||||
VALUE where)
|
||||
{
|
||||
char *c_completion, *c_word, *c_where;
|
||||
int c_nick_completion;
|
||||
|
||||
API_INIT_FUNC(1, "completion_list_add", API_RETURN_ERROR);
|
||||
if (NIL_P (completion) || NIL_P (word) || NIL_P (nick_completion)
|
||||
|| NIL_P (where))
|
||||
API_WRONG_ARGS(API_RETURN_ERROR);
|
||||
|
||||
Check_Type (completion, T_STRING);
|
||||
Check_Type (word, T_STRING);
|
||||
CHECK_INTEGER(nick_completion);
|
||||
Check_Type (where, T_STRING);
|
||||
|
||||
c_completion = StringValuePtr (completion);
|
||||
c_word = StringValuePtr (word);
|
||||
c_nick_completion = NUM2INT (nick_completion);
|
||||
c_where = StringValuePtr (where);
|
||||
|
||||
weechat_completion_list_add (API_STR2PTR(c_completion),
|
||||
c_word,
|
||||
c_nick_completion,
|
||||
c_where);
|
||||
|
||||
API_RETURN_OK;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
weechat_ruby_api_completion_free (VALUE class, VALUE completion)
|
||||
{
|
||||
@@ -6488,6 +6552,8 @@ weechat_ruby_api_init (VALUE ruby_mWeechat)
|
||||
API_DEF_FUNC(command_options, 3);
|
||||
API_DEF_FUNC(completion_new, 1);
|
||||
API_DEF_FUNC(completion_search, 4);
|
||||
API_DEF_FUNC(completion_get_string, 2);
|
||||
API_DEF_FUNC(completion_list_add, 4);
|
||||
API_DEF_FUNC(completion_free, 1);
|
||||
API_DEF_FUNC(info_get, 2);
|
||||
API_DEF_FUNC(info_get_hashtable, 2);
|
||||
|
||||
@@ -49,9 +49,9 @@ script_completion_languages_cb (const void *pointer, void *data,
|
||||
|
||||
for (i = 0; i < SCRIPT_NUM_LANGUAGES; i++)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion,
|
||||
script_language[i],
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion,
|
||||
script_language[i],
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
@@ -77,9 +77,9 @@ script_completion_extensions_cb (const void *pointer, void *data,
|
||||
|
||||
for (i = 0; i < SCRIPT_NUM_LANGUAGES; i++)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion,
|
||||
script_extension[i],
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion,
|
||||
script_extension[i],
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
@@ -106,9 +106,9 @@ script_completion_scripts_cb (const void *pointer, void *data,
|
||||
for (ptr_script = scripts_repo; ptr_script;
|
||||
ptr_script = ptr_script->next_script)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion,
|
||||
ptr_script->name_with_extension,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion,
|
||||
ptr_script->name_with_extension,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
@@ -137,9 +137,9 @@ script_completion_scripts_installed_cb (const void *pointer, void *data,
|
||||
{
|
||||
if (ptr_script->status & SCRIPT_STATUS_INSTALLED)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion,
|
||||
ptr_script->name_with_extension,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion,
|
||||
ptr_script->name_with_extension,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,9 +172,9 @@ script_completion_exec_file_cb (void *data, const char *filename)
|
||||
if (filename2)
|
||||
{
|
||||
ptr_base_name = basename (filename2);
|
||||
weechat_hook_completion_list_add (completion,
|
||||
ptr_base_name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion,
|
||||
ptr_base_name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
free (filename2);
|
||||
}
|
||||
}
|
||||
@@ -271,9 +271,9 @@ script_completion_tags_cb (const void *pointer, void *data,
|
||||
{
|
||||
for (i = 0; i < num_tags; i++)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion,
|
||||
list_tags[i],
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion,
|
||||
list_tags[i],
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
weechat_string_free_split (list_tags);
|
||||
}
|
||||
|
||||
@@ -48,9 +48,9 @@ spell_completion_langs_cb (const void *pointer, void *data,
|
||||
|
||||
for (i = 0; spell_langs[i].code; i++)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion,
|
||||
spell_langs[i].code,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion,
|
||||
spell_langs[i].code,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
@@ -73,8 +73,8 @@ spell_completion_enchant_add_dict_cb (const char *lang_tag,
|
||||
(void) provider_desc;
|
||||
(void) provider_file;
|
||||
|
||||
weechat_hook_completion_list_add ((struct t_gui_completion *)user_data,
|
||||
lang_tag, 0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add ((struct t_gui_completion *)user_data,
|
||||
lang_tag, 0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
#endif /* USE_ENCHANT */
|
||||
|
||||
@@ -112,8 +112,8 @@ spell_completion_dicts_cb (const void *pointer, void *data,
|
||||
|
||||
while ((dict = aspell_dict_info_enumeration_next (elements)) != NULL)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion, dict->name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, dict->name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
|
||||
delete_aspell_dict_info_enumeration (elements);
|
||||
|
||||
@@ -2332,6 +2332,11 @@ API_FUNC(hook_completion)
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function deprecated since WeeChat 2.9, kept for compatibility.
|
||||
* It is replaced by completion_get_string.
|
||||
*/
|
||||
|
||||
API_FUNC(hook_completion_get_string)
|
||||
{
|
||||
Tcl_Obj *objp;
|
||||
@@ -2352,6 +2357,11 @@ API_FUNC(hook_completion_get_string)
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function deprecated since WeeChat 2.9, kept for compatibility.
|
||||
* It is replaced by completion_list_add.
|
||||
*/
|
||||
|
||||
API_FUNC(hook_completion_list_add)
|
||||
{
|
||||
Tcl_Obj *objp;
|
||||
@@ -4665,6 +4675,51 @@ API_FUNC(completion_search)
|
||||
API_RETURN_INT(rc);
|
||||
}
|
||||
|
||||
API_FUNC(completion_get_string)
|
||||
{
|
||||
Tcl_Obj *objp;
|
||||
char *completion, *property;
|
||||
const char *result;
|
||||
int i;
|
||||
|
||||
API_INIT_FUNC(1, "completion_get_string", API_RETURN_EMPTY);
|
||||
if (objc < 3)
|
||||
API_WRONG_ARGS(API_RETURN_EMPTY);
|
||||
|
||||
completion = Tcl_GetStringFromObj (objv[1], &i);
|
||||
property = Tcl_GetStringFromObj (objv[2], &i);
|
||||
|
||||
result = weechat_completion_get_string (API_STR2PTR(completion),
|
||||
property);
|
||||
|
||||
API_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
API_FUNC(completion_list_add)
|
||||
{
|
||||
Tcl_Obj *objp;
|
||||
char *completion, *word, *where;
|
||||
int i, nick_completion;
|
||||
|
||||
API_INIT_FUNC(1, "completion_list_add", API_RETURN_ERROR);
|
||||
if (objc < 5)
|
||||
API_WRONG_ARGS(API_RETURN_ERROR);
|
||||
|
||||
if (Tcl_GetIntFromObj (interp, objv[3], &nick_completion) != TCL_OK)
|
||||
API_WRONG_ARGS(API_RETURN_ERROR);
|
||||
|
||||
completion = Tcl_GetStringFromObj (objv[1], &i);
|
||||
word = Tcl_GetStringFromObj (objv[2], &i);
|
||||
where = Tcl_GetStringFromObj (objv[4], &i);
|
||||
|
||||
weechat_completion_list_add (API_STR2PTR(completion),
|
||||
word,
|
||||
nick_completion, /* nick_completion */
|
||||
where);
|
||||
|
||||
API_RETURN_OK;
|
||||
}
|
||||
|
||||
API_FUNC(info_get)
|
||||
{
|
||||
Tcl_Obj *objp;
|
||||
@@ -5823,6 +5878,8 @@ void weechat_tcl_api_init (Tcl_Interp *interp)
|
||||
API_DEF_FUNC(command_options);
|
||||
API_DEF_FUNC(completion_new);
|
||||
API_DEF_FUNC(completion_search);
|
||||
API_DEF_FUNC(completion_get_string);
|
||||
API_DEF_FUNC(completion_list_add);
|
||||
API_DEF_FUNC(info_get);
|
||||
API_DEF_FUNC(info_get_hashtable);
|
||||
API_DEF_FUNC(infolist_new);
|
||||
|
||||
@@ -49,8 +49,8 @@ trigger_completion_triggers_cb (const void *pointer, void *data,
|
||||
for (ptr_trigger = triggers; ptr_trigger;
|
||||
ptr_trigger = ptr_trigger->next_trigger)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion, ptr_trigger->name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion, ptr_trigger->name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
@@ -77,9 +77,9 @@ trigger_completion_triggers_default_cb (const void *pointer, void *data,
|
||||
|
||||
for (i = 0; trigger_config_default_list[i][0]; i++)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion,
|
||||
trigger_config_default_list[i][0],
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion,
|
||||
trigger_config_default_list[i][0],
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
@@ -105,9 +105,9 @@ trigger_completion_options_cb (const void *pointer, void *data,
|
||||
|
||||
for (i = 0; i < TRIGGER_NUM_OPTIONS; i++)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion,
|
||||
trigger_option_string[i],
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion,
|
||||
trigger_option_string[i],
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
@@ -134,7 +134,7 @@ trigger_completion_option_value_cb (const void *pointer, void *data,
|
||||
(void) completion_item;
|
||||
(void) buffer;
|
||||
|
||||
args = weechat_hook_completion_get_string (completion, "args");
|
||||
args = weechat_completion_get_string (completion, "args");
|
||||
if (!args)
|
||||
return WEECHAT_RC_OK;
|
||||
|
||||
@@ -153,20 +153,21 @@ trigger_completion_option_value_cb (const void *pointer, void *data,
|
||||
{
|
||||
if (weechat_strcasecmp (argv[2], "name") == 0)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion,
|
||||
ptr_trigger->name,
|
||||
0,
|
||||
WEECHAT_LIST_POS_BEGINNING);
|
||||
weechat_completion_list_add (completion,
|
||||
ptr_trigger->name,
|
||||
0,
|
||||
WEECHAT_LIST_POS_BEGINNING);
|
||||
}
|
||||
else
|
||||
{
|
||||
index_option = trigger_search_option (argv[2]);
|
||||
if (index_option >= 0)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion,
|
||||
weechat_config_string (ptr_trigger->options[index_option]),
|
||||
0,
|
||||
WEECHAT_LIST_POS_BEGINNING);
|
||||
weechat_completion_list_add (
|
||||
completion,
|
||||
weechat_config_string (ptr_trigger->options[index_option]),
|
||||
0,
|
||||
WEECHAT_LIST_POS_BEGINNING);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -197,9 +198,9 @@ trigger_completion_hooks_cb (const void *pointer, void *data,
|
||||
|
||||
for (i = 0; i < TRIGGER_NUM_HOOK_TYPES; i++)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion,
|
||||
trigger_hook_type_string[i],
|
||||
0, WEECHAT_LIST_POS_END);
|
||||
weechat_completion_list_add (completion,
|
||||
trigger_hook_type_string[i],
|
||||
0, WEECHAT_LIST_POS_END);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
@@ -228,8 +229,8 @@ trigger_completion_hooks_filter_cb (const void *pointer, void *data,
|
||||
{
|
||||
snprintf (str_hook, sizeof (str_hook),
|
||||
"@%s", trigger_hook_type_string[i]);
|
||||
weechat_hook_completion_list_add (completion, str_hook,
|
||||
0, WEECHAT_LIST_POS_END);
|
||||
weechat_completion_list_add (completion, str_hook,
|
||||
0, WEECHAT_LIST_POS_END);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
@@ -252,8 +253,7 @@ trigger_completion_add_quoted_word (struct t_gui_completion *completion,
|
||||
return;
|
||||
|
||||
snprintf (temp, length, "\"%s\"", word);
|
||||
weechat_hook_completion_list_add (completion, temp, 0,
|
||||
WEECHAT_LIST_POS_END);
|
||||
weechat_completion_list_add (completion, temp, 0, WEECHAT_LIST_POS_END);
|
||||
|
||||
free (temp);
|
||||
}
|
||||
@@ -273,7 +273,7 @@ trigger_completion_add_default_for_hook (struct t_gui_completion *completion,
|
||||
char **argv, **items;
|
||||
int argc, num_items, type, i;
|
||||
|
||||
args = weechat_hook_completion_get_string (completion, "args");
|
||||
args = weechat_completion_get_string (completion, "args");
|
||||
if (!args)
|
||||
return;
|
||||
|
||||
@@ -341,8 +341,7 @@ trigger_completion_hook_arguments_cb (const void *pointer, void *data,
|
||||
trigger_completion_add_default_for_hook (completion,
|
||||
trigger_hook_default_arguments,
|
||||
NULL);
|
||||
weechat_hook_completion_list_add (completion, "\"\"", 0,
|
||||
WEECHAT_LIST_POS_END);
|
||||
weechat_completion_list_add (completion, "\"\"", 0, WEECHAT_LIST_POS_END);
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
@@ -363,12 +362,11 @@ trigger_completion_hook_conditions_cb (const void *pointer, void *data,
|
||||
(void) completion_item;
|
||||
(void) buffer;
|
||||
|
||||
weechat_hook_completion_list_add (completion,
|
||||
"\"" TRIGGER_HOOK_DEFAULT_CONDITIONS "\"",
|
||||
0,
|
||||
WEECHAT_LIST_POS_END);
|
||||
weechat_hook_completion_list_add (completion, "\"\"", 0,
|
||||
WEECHAT_LIST_POS_END);
|
||||
weechat_completion_list_add (completion,
|
||||
"\"" TRIGGER_HOOK_DEFAULT_CONDITIONS "\"",
|
||||
0,
|
||||
WEECHAT_LIST_POS_END);
|
||||
weechat_completion_list_add (completion, "\"\"", 0, WEECHAT_LIST_POS_END);
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
@@ -389,12 +387,11 @@ trigger_completion_hook_regex_cb (const void *pointer, void *data,
|
||||
(void) completion_item;
|
||||
(void) buffer;
|
||||
|
||||
weechat_hook_completion_list_add (completion,
|
||||
"\"" TRIGGER_HOOK_DEFAULT_REGEX "\"",
|
||||
0,
|
||||
WEECHAT_LIST_POS_END);
|
||||
weechat_hook_completion_list_add (completion, "\"\"", 0,
|
||||
WEECHAT_LIST_POS_END);
|
||||
weechat_completion_list_add (completion,
|
||||
"\"" TRIGGER_HOOK_DEFAULT_REGEX "\"",
|
||||
0,
|
||||
WEECHAT_LIST_POS_END);
|
||||
weechat_completion_list_add (completion, "\"\"", 0, WEECHAT_LIST_POS_END);
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
@@ -415,12 +412,11 @@ trigger_completion_hook_command_cb (const void *pointer, void *data,
|
||||
(void) completion_item;
|
||||
(void) buffer;
|
||||
|
||||
weechat_hook_completion_list_add (completion,
|
||||
"\"" TRIGGER_HOOK_DEFAULT_COMMAND "\"",
|
||||
0,
|
||||
WEECHAT_LIST_POS_END);
|
||||
weechat_hook_completion_list_add (completion, "\"\"", 0,
|
||||
WEECHAT_LIST_POS_END);
|
||||
weechat_completion_list_add (completion,
|
||||
"\"" TRIGGER_HOOK_DEFAULT_COMMAND "\"",
|
||||
0,
|
||||
WEECHAT_LIST_POS_END);
|
||||
weechat_completion_list_add (completion, "\"\"", 0, WEECHAT_LIST_POS_END);
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ struct timeval;
|
||||
* please change the date with current one; for a second change at same
|
||||
* date, increment the 01, otherwise please keep 01.
|
||||
*/
|
||||
#define WEECHAT_PLUGIN_API_VERSION "20200428-01"
|
||||
#define WEECHAT_PLUGIN_API_VERSION "20200508-01"
|
||||
|
||||
/* macros for defining plugin infos */
|
||||
#define WEECHAT_PLUGIN_NAME(__name) \
|
||||
@@ -1014,6 +1014,12 @@ struct t_weechat_plugin
|
||||
struct t_gui_buffer *buffer);
|
||||
int (*completion_search) (struct t_gui_completion *completion,
|
||||
const char *data, int position, int direction);
|
||||
const char *(*completion_get_string) (struct t_gui_completion *completion,
|
||||
const char *property);
|
||||
void (*completion_list_add) (struct t_gui_completion *completion,
|
||||
const char *word,
|
||||
int nick_completion,
|
||||
const char *where);
|
||||
void (*completion_free) (struct t_gui_completion *completion);
|
||||
|
||||
/* network */
|
||||
@@ -1956,6 +1962,12 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin);
|
||||
__direction) \
|
||||
(weechat_plugin->completion_search)(__completion, __data, \
|
||||
__position, __direction)
|
||||
#define weechat_completion_get_string(__completion, __property) \
|
||||
(weechat_plugin->completion_get_string)(__completion, __property)
|
||||
#define weechat_completion_list_add(__completion, __word, \
|
||||
__nick_completion, __where) \
|
||||
(weechat_plugin->completion_list_add)(__completion, __word, \
|
||||
__nick_completion, __where)
|
||||
#define weechat_completion_free(__completion) \
|
||||
(weechat_plugin->completion_free)(__completion)
|
||||
|
||||
|
||||
@@ -49,15 +49,15 @@ xfer_completion_nick_cb (const void *pointer, void *data,
|
||||
if (ptr_xfer)
|
||||
{
|
||||
/* remote nick */
|
||||
weechat_hook_completion_list_add (completion,
|
||||
ptr_xfer->remote_nick,
|
||||
0,
|
||||
WEECHAT_LIST_POS_SORT);
|
||||
weechat_completion_list_add (completion,
|
||||
ptr_xfer->remote_nick,
|
||||
0,
|
||||
WEECHAT_LIST_POS_SORT);
|
||||
/* add self nick at the end */
|
||||
weechat_hook_completion_list_add (completion,
|
||||
ptr_xfer->local_nick,
|
||||
1,
|
||||
WEECHAT_LIST_POS_END);
|
||||
weechat_completion_list_add (completion,
|
||||
ptr_xfer->local_nick,
|
||||
1,
|
||||
WEECHAT_LIST_POS_END);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
|
||||
Reference in New Issue
Block a user