1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

/AWAY reason tab completion, patch by c0ffee.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2824 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2002-05-26 16:30:19 +00:00 committed by cras
parent 6b7c38d1c6
commit b95f6acc4f

View File

@ -759,6 +759,25 @@ static void sig_complete_topic(GList **list, WINDOW_REC *window,
}
}
static void sig_complete_away(GList **list, WINDOW_REC *window,
const char *word, const char *line,
int *want_space)
{
const char *reason;
g_return_if_fail(list != NULL);
g_return_if_fail(word != NULL);
if (*word == '\0' && window->active_server != NULL) {
reason = SERVER(window->active_server)->away_reason;
if (reason != NULL) {
*list = g_list_append(NULL, g_strdup(reason));
signal_stop();
}
}
}
static void sig_complete_channel(GList **list, WINDOW_REC *window,
const char *word, const char *line,
int *want_space)
@ -934,6 +953,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 away", (SIGNAL_FUNC) sig_complete_away);
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);
@ -963,6 +983,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 away", (SIGNAL_FUNC) sig_complete_away);
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);