summaryrefslogtreecommitdiff
path: root/src/fe-common/irc
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-10-14 16:12:01 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-10-14 16:12:01 +0000
commitfb5c4c8037b51e42ad89fe5fa4f979496bd314af (patch)
treec43d6488c070b0ba4c6c2c74f573ca97520ffe75 /src/fe-common/irc
parentfa1687596c0d04dc381851b5d375be893574d3fc (diff)
downloadirssi-fb5c4c8037b51e42ad89fe5fa4f979496bd314af.zip
More tab completion: /DISCONNECT, /SERVER ADD|REMOVE, /STATS
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2954 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common/irc')
-rw-r--r--src/fe-common/irc/Makefile.am1
-rw-r--r--src/fe-common/irc/fe-common-irc.c5
-rw-r--r--src/fe-common/irc/irc-completion.c41
3 files changed, 47 insertions, 0 deletions
diff --git a/src/fe-common/irc/Makefile.am b/src/fe-common/irc/Makefile.am
index d633d247..99e3aa44 100644
--- a/src/fe-common/irc/Makefile.am
+++ b/src/fe-common/irc/Makefile.am
@@ -25,6 +25,7 @@ real_sources = \
fe-netjoin.c \
fe-netsplit.c \
fe-common-irc.c \
+ irc-completion.c \
module-formats.c
libfe_common_irc_a_SOURCES = \
diff --git a/src/fe-common/irc/fe-common-irc.c b/src/fe-common/irc/fe-common-irc.c
index 9c0f6716..5168481f 100644
--- a/src/fe-common/irc/fe-common-irc.c
+++ b/src/fe-common/irc/fe-common-irc.c
@@ -68,6 +68,9 @@ void fe_netsplit_deinit(void);
void fe_netjoin_init(void);
void fe_netjoin_deinit(void);
+void irc_completion_init(void);
+void irc_completion_deinit(void);
+
void fe_common_irc_init(void)
{
settings_add_bool("lookandfeel", "show_away_once", TRUE);
@@ -86,6 +89,7 @@ void fe_common_irc_init(void)
fe_modes_init();
fe_netsplit_init();
fe_netjoin_init();
+ irc_completion_init();
settings_check();
module_register("core", "fe-irc");
@@ -109,6 +113,7 @@ void fe_common_irc_deinit(void)
fe_modes_deinit();
fe_netsplit_deinit();
fe_netjoin_deinit();
+ irc_completion_deinit();
theme_unregister();
}
diff --git a/src/fe-common/irc/irc-completion.c b/src/fe-common/irc/irc-completion.c
new file mode 100644
index 00000000..1d3b9a75
--- /dev/null
+++ b/src/fe-common/irc/irc-completion.c
@@ -0,0 +1,41 @@
+/*
+ irc-completion.c : irssi
+
+ Copyright (C) 1999-2000 Timo Sirainen
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include "module.h"
+#include "signals.h"
+#include "chat-completion.h"
+
+static void sig_complete_stats(GList **list, WINDOW_REC *window,
+ const char *word, const char *line,
+ int *want_space)
+{
+ *list = completion_get_servers(word);
+ if (*list != NULL) signal_stop();
+}
+
+void irc_completion_init(void)
+{
+ signal_add("complete command stats", (SIGNAL_FUNC) sig_complete_stats);
+}
+
+void irc_completion_deinit(void)
+{
+ signal_remove("complete command stats", (SIGNAL_FUNC) sig_complete_stats);
+}