diff options
author | Timo Sirainen <cras@irssi.org> | 2004-07-08 23:31:31 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2004-07-08 23:31:31 +0000 |
commit | 1d6ed93102a8993b476bd9681b6ae76cb356ba2e (patch) | |
tree | 40e525765f8c9896142f40ce50dfd4ddf5aac62f /src | |
parent | d12202f79e7f619fcd8dd39f5a8b9cb065f964f8 (diff) | |
download | irssi-1d6ed93102a8993b476bd9681b6ae76cb356ba2e.zip |
Added -ircnet option to /IGNORE. Patch by Valentin Batz
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3259 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r-- | src/fe-common/core/fe-ignore.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/fe-common/core/fe-ignore.c b/src/fe-common/core/fe-ignore.c index 83bc1584..3b834299 100644 --- a/src/fe-common/core/fe-ignore.c +++ b/src/fe-common/core/fe-ignore.c @@ -63,6 +63,8 @@ static void ignore_print(int index, IGNORE_REC *rec) } if (rec->fullword) g_string_append(options, "-full "); if (rec->replies) g_string_append(options, "-replies "); + if (rec->servertag != NULL) + g_string_sprintfa(options, "-ircnet %s ", rec->servertag); if (rec->pattern != NULL) g_string_sprintfa(options, "-pattern %s ", rec->pattern); @@ -105,14 +107,14 @@ static void cmd_ignore_show(void) } /* SYNTAX: IGNORE [-regexp | -full] [-pattern <pattern>] [-except] [-replies] - [-channels <channel>] [-time <secs>] <mask> [<levels>] + [-ircnet <ircnet>] [-channels <channel>] [-time <secs>] <mask> [<levels>] IGNORE [-regexp | -full] [-pattern <pattern>] [-except] [-replies] - [-time <secs>] <channels> [<levels>] */ + [-ircnet <ircnet>] [-time <secs>] <channels> [<levels>] */ static void cmd_ignore(const char *data) { GHashTable *optlist; IGNORE_REC *rec; - char *patternarg, *chanarg, *mask, *levels, *timestr; + char *patternarg, *chanarg, *mask, *levels, *timestr, *servertag; char **channels; void *free_arg; int new_ignore, msecs; @@ -128,7 +130,8 @@ static void cmd_ignore(const char *data) patternarg = g_hash_table_lookup(optlist, "pattern"); chanarg = g_hash_table_lookup(optlist, "channels"); - + servertag = g_hash_table_lookup(optlist, "ircnet"); + if (*mask == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); if (*levels == '\0') levels = "ALL"; @@ -173,7 +176,8 @@ static void cmd_ignore(const char *data) cmd_params_free(free_arg); return; } - + rec->servertag = (servertag == NULL || *servertag == '\0') ? + NULL : g_strdup(servertag); rec->pattern = (patternarg == NULL || *patternarg == '\0') ? NULL : g_strdup(patternarg); rec->exception = g_hash_table_lookup(optlist, "except") != NULL; @@ -254,7 +258,7 @@ void fe_ignore_init(void) signal_add("ignore created", (SIGNAL_FUNC) sig_ignore_created); signal_add("ignore changed", (SIGNAL_FUNC) sig_ignore_created); - command_set_options("ignore", "regexp full except replies -time -pattern -channels"); + command_set_options("ignore", "regexp full except replies -ircnet -time -pattern -channels"); } void fe_ignore_deinit(void) |