X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=apps%2Firssi%2Fsrc%2Ffe-common%2Fcore%2Fchat-completion.c;h=df5525eb4ad08765f979c893e8b99e2f8967b188;hb=9601176a506c8a545a954891e5e25552e9609159;hp=2c23a6ab7510b7de9c4e66231174e47367edc68e;hpb=8efe5c6b18756ea335788ebf0afdf294764f4c26;p=crypto.git diff --git a/apps/irssi/src/fe-common/core/chat-completion.c b/apps/irssi/src/fe-common/core/chat-completion.c index 2c23a6ab..df5525eb 100644 --- a/apps/irssi/src/fe-common/core/chat-completion.c +++ b/apps/irssi/src/fe-common/core/chat-completion.c @@ -757,6 +757,17 @@ static void sig_complete_topic(GList **list, WINDOW_REC *window, } } +static void sig_complete_channel(GList **list, WINDOW_REC *window, + const char *word, const char *line, + int *want_space) +{ + g_return_if_fail(list != NULL); + g_return_if_fail(word != NULL); + + *list = completion_get_channels(NULL, word); + if (*list != NULL) signal_stop(); +} + /* expand \n, \t and \\ */ static char *expand_escapes(const char *line, SERVER_REC *server, WI_ITEM_REC *item) @@ -921,6 +932,7 @@ void chat_completion_init(void) signal_add("complete command connect", (SIGNAL_FUNC) sig_complete_connect); signal_add("complete command server", (SIGNAL_FUNC) sig_complete_connect); signal_add("complete command topic", (SIGNAL_FUNC) sig_complete_topic); + signal_add("complete command window item move", (SIGNAL_FUNC) sig_complete_channel); signal_add("message public", (SIGNAL_FUNC) sig_message_public); signal_add("message join", (SIGNAL_FUNC) sig_message_join); signal_add("message private", (SIGNAL_FUNC) sig_message_private); @@ -949,6 +961,7 @@ void chat_completion_deinit(void) signal_remove("complete command connect", (SIGNAL_FUNC) sig_complete_connect); signal_remove("complete command server", (SIGNAL_FUNC) sig_complete_connect); signal_remove("complete command topic", (SIGNAL_FUNC) sig_complete_topic); + signal_remove("complete command window item move", (SIGNAL_FUNC) sig_complete_channel); signal_remove("message public", (SIGNAL_FUNC) sig_message_public); signal_remove("message join", (SIGNAL_FUNC) sig_message_join); signal_remove("message private", (SIGNAL_FUNC) sig_message_private);