summaryrefslogtreecommitdiff
path: root/src/plugins/relay
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2019-06-04 22:29:18 +0200
committerSébastien Helleu <flashcode@flashtux.org>2019-06-04 22:29:18 +0200
commitb4dadd6d988e6e63890d6d7da46fe16d9ea56cd4 (patch)
tree20f8d75f51b98700f7511dc5d1db80480aeaa676 /src/plugins/relay
parentbfbb511169571a3213e15bcdcb0e10de85dbeddf (diff)
downloadweechat-b4dadd6d988e6e63890d6d7da46fe16d9ea56cd4.zip
relay: add UNIX domain socket completion for command /relay add (issue #733)
Diffstat (limited to 'src/plugins/relay')
-rw-r--r--src/plugins/relay/relay-completion.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/plugins/relay/relay-completion.c b/src/plugins/relay/relay-completion.c
index 336661480..1cfe62744 100644
--- a/src/plugins/relay/relay-completion.c
+++ b/src/plugins/relay/relay-completion.c
@@ -39,7 +39,7 @@ relay_completion_protocol_name_cb (const void *pointer, void *data,
struct t_gui_completion *completion)
{
struct t_infolist *infolist;
- char protocol_name[512];
+ char protocol_name[1024];
/* make C compiler happy */
(void) pointer;
@@ -52,6 +52,7 @@ relay_completion_protocol_name_cb (const void *pointer, void *data,
{
while (weechat_infolist_next (infolist))
{
+ /* TCP socket */
snprintf (protocol_name, sizeof (protocol_name), "irc.%s",
weechat_infolist_string (infolist, "name"));
weechat_hook_completion_list_add (completion, protocol_name,
@@ -60,15 +61,31 @@ relay_completion_protocol_name_cb (const void *pointer, void *data,
weechat_infolist_string (infolist, "name"));
weechat_hook_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);
+ 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_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);
+ /* 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);
+
return WEECHAT_RC_OK;
}