summaryrefslogtreecommitdiff
path: root/src/plugins/irc
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2009-10-10 12:04:20 +0200
committerSebastien Helleu <flashcode@flashtux.org>2009-10-10 12:04:20 +0200
commit62946024d864dbebeefbb40a7737f104aabcb5f9 (patch)
tree232b2849dd5c298f9da5f24ee5474cd1f35429a2 /src/plugins/irc
parent1905344fdb19906e36b85c63e5d1bff1717393f5 (diff)
downloadweechat-62946024d864dbebeefbb40a7737f104aabcb5f9.zip
Add IRC command /sajoin (task #9770)
Diffstat (limited to 'src/plugins/irc')
-rw-r--r--src/plugins/irc/irc-command.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c
index e5985a20e..f6532e9fd 100644
--- a/src/plugins/irc/irc-command.c
+++ b/src/plugins/irc/irc-command.c
@@ -2736,6 +2736,32 @@ irc_command_restart (void *data, struct t_gui_buffer *buffer, int argc,
}
/*
+ * irc_command_sajoin: forces a user to join channel(s)
+ */
+
+int
+irc_command_sajoin (void *data, struct t_gui_buffer *buffer, int argc,
+ char **argv, char **argv_eol)
+{
+ IRC_GET_SERVER_CHANNEL(buffer);
+ IRC_COMMAND_CHECK_SERVER("sajoin", 1);
+
+ /* make C compiler happy */
+ (void) data;
+
+ if (argc > 2)
+ {
+ irc_server_sendf (ptr_server, 0, "SAJOIN %s %s", argv[1], argv_eol[2]);
+ }
+ else
+ {
+ IRC_COMMAND_TOO_FEW_ARGUMENTS(ptr_server->buffer, "sajoin");
+ }
+
+ return WEECHAT_RC_OK;
+}
+
+/*
* irc_command_server: manage IRC servers
*/
@@ -4007,6 +4033,12 @@ irc_command_init ()
"",
"",
NULL, &irc_command_restart, NULL);
+ weechat_hook_command ("sajoin",
+ N_("forces a user to join channel(s)"),
+ N_("nickname channel[,channel]"),
+ N_("nickname: nickname\n"
+ " channel: channel name"),
+ "%(nicks) %(irc_channels)", &irc_command_sajoin, NULL);
weechat_hook_command ("service",
N_("register a new service"),
N_("nickname reserved distribution type reserved "