summaryrefslogtreecommitdiff
path: root/src/fe-common/irc/fe-irc-commands.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-08-14 12:33:29 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-08-14 12:33:29 +0000
commit6c022b0a5e8d826f6c017f6646342fbb5f563f1f (patch)
tree1c87fc01ec43762bd2a9b244cd92851e9cb7dc2a /src/fe-common/irc/fe-irc-commands.c
parent1de695ae1a0924a71be2bf108dc6a6196f4074c0 (diff)
downloadirssi-6c022b0a5e8d826f6c017f6646342fbb5f563f1f.zip
Some support for lain ircd's /SETHOST - It /PART + /JOINs all channels, so
add all the joined channels to window binds temporarily so /PART doesn't close the windows if /SET autoclose_windows is ON. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1757 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common/irc/fe-irc-commands.c')
-rw-r--r--src/fe-common/irc/fe-irc-commands.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/fe-common/irc/fe-irc-commands.c b/src/fe-common/irc/fe-irc-commands.c
index 2ec00b1b..6afcea10 100644
--- a/src/fe-common/irc/fe-irc-commands.c
+++ b/src/fe-common/irc/fe-irc-commands.c
@@ -442,6 +442,28 @@ static void cmd_oper(const char *data, IRC_SERVER_REC *server)
cmd_params_free(free_arg);
}
+/* SYNTAX: SETHOST <host> <password> (non-ircops)
+ SETHOST <ident> <host> (ircops) */
+static void cmd_sethost(const char *data, IRC_SERVER_REC *server)
+{
+ GSList *tmp;
+
+ g_return_if_fail(data != NULL);
+ if (!IS_IRC_SERVER(server) || !server->connected)
+ cmd_return_error(CMDERR_NOT_CONNECTED);
+
+ /* Save all the joined channels in server to window binds, since
+ the server will soon /PART + /JOIN us in all channels. */
+ for (tmp = server->channels; tmp != NULL; tmp = tmp->next) {
+ CHANNEL_REC *channel = tmp->data;
+
+ window_bind_add(window_item_window(channel),
+ server->tag, channel->name);
+ }
+
+ irc_send_cmdv(server, "SETHOST %s", data);
+}
+
void fe_irc_commands_init(void)
{
command_bind_last("me", NULL, (SIGNAL_FUNC) cmd_me);
@@ -458,6 +480,7 @@ void fe_irc_commands_init(void)
command_bind("topic", NULL, (SIGNAL_FUNC) cmd_topic);
command_bind("ts", NULL, (SIGNAL_FUNC) cmd_ts);
command_bind("oper", NULL, (SIGNAL_FUNC) cmd_oper);
+ command_bind("sethost", NULL, (SIGNAL_FUNC) cmd_sethost);
}
void fe_irc_commands_deinit(void)
@@ -476,4 +499,5 @@ void fe_irc_commands_deinit(void)
command_unbind("topic", (SIGNAL_FUNC) cmd_topic);
command_unbind("ts", (SIGNAL_FUNC) cmd_ts);
command_unbind("oper", (SIGNAL_FUNC) cmd_oper);
+ command_unbind("sethost", (SIGNAL_FUNC) cmd_sethost);
}