diff options
author | Timo Sirainen <cras@irssi.org> | 2000-10-01 21:00:59 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-10-01 21:00:59 +0000 |
commit | 54ee1c6e8cdfa2c9f96914dcc80cd75165267e8c (patch) | |
tree | 3cf9ff23d5eadc21f1f82d6d8f6527986dde2006 /src/irc | |
parent | 62dee8fdafe558b638cfc1995841e3ca7e007368 (diff) | |
download | irssi-54ee1c6e8cdfa2c9f96914dcc80cd75165267e8c.zip |
/SILENCE updates, added /UNSILENCE command.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@706 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc')
-rw-r--r-- | src/irc/core/irc-commands.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/irc/core/irc-commands.c b/src/irc/core/irc-commands.c index 5c8fe19b..170921c4 100644 --- a/src/irc/core/irc-commands.c +++ b/src/irc/core/irc-commands.c @@ -821,6 +821,19 @@ static void cmd_oper(const char *data, IRC_SERVER_REC *server) cmd_params_free(free_arg); } +/* SYNTAX: UNSILENCE <nick!user@host> */ +static void cmd_unsilence(const char *data, IRC_SERVER_REC *server) +{ + g_return_if_fail(data != NULL); + if (!IS_IRC_SERVER(server) || !server->connected) + cmd_return_error(CMDERR_NOT_CONNECTED); + + if (*data == '\0') + cmd_return_error(CMDERR_NOT_ENOUGH_PARAMS); + + irc_send_cmdv(server, "SILENCE -%s", data); +} + static void command_self(const char *data, IRC_SERVER_REC *server) { g_return_if_fail(data != NULL); @@ -932,6 +945,7 @@ void irc_commands_init(void) /* SYNTAX: SILENCE [[+|-]<nick!user@host>] SILENCE [<nick>] */ command_bind("silence", NULL, (SIGNAL_FUNC) command_self); + command_bind("unsilence", NULL, (SIGNAL_FUNC) cmd_unsilence); command_bind("sconnect", NULL, (SIGNAL_FUNC) cmd_sconnect); /* SYNTAX: SQUERY <service> [<commands>] */ command_bind("squery", NULL, (SIGNAL_FUNC) command_2self); @@ -1011,6 +1025,7 @@ void irc_commands_deinit(void) command_unbind("version", (SIGNAL_FUNC) command_self); command_unbind("servlist", (SIGNAL_FUNC) command_self); command_unbind("silence", (SIGNAL_FUNC) command_self); + command_unbind("unsilence", (SIGNAL_FUNC) cmd_unsilence); command_unbind("sconnect", (SIGNAL_FUNC) cmd_sconnect); command_unbind("squery", (SIGNAL_FUNC) command_2self); command_unbind("deop", (SIGNAL_FUNC) cmd_deop); |