summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-05-26 16:30:19 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-05-26 16:30:19 +0000
commitb95f6acc4fe6751e781aa8004864040976393e9a (patch)
tree2b87c10413c0c6fa9382c86c8679ef94750db55a
parent6b7c38d1c63ffa2c34b356ff2f90c98862ac2a29 (diff)
downloadirssi-b95f6acc4fe6751e781aa8004864040976393e9a.zip
/AWAY reason tab completion, patch by c0ffee.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2824 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r--src/fe-common/core/chat-completion.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/fe-common/core/chat-completion.c b/src/fe-common/core/chat-completion.c
index 2de58a5a..21f0ef10 100644
--- a/src/fe-common/core/chat-completion.c
+++ b/src/fe-common/core/chat-completion.c
@@ -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);