summaryrefslogtreecommitdiff
path: root/src/irc/irc-send.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2005-04-19 21:02:59 +0000
committerSebastien Helleu <flashcode@flashtux.org>2005-04-19 21:02:59 +0000
commit5ebab583f6311af24e8f90e428c724bc7225b5ba (patch)
tree4f56185602f2b829ba8871645ae6f83d747fa89a /src/irc/irc-send.c
parentca117dbb2429b9f8e8b95c11a42a02d8fb4495d2 (diff)
downloadweechat-5ebab583f6311af24e8f90e428c724bc7225b5ba.zip
Added "-all" option for /nick command, added "341" IRC command (for invitation)
Diffstat (limited to 'src/irc/irc-send.c')
-rw-r--r--src/irc/irc-send.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/irc/irc-send.c b/src/irc/irc-send.c
index a49ef7e4d..f0610d8a6 100644
--- a/src/irc/irc-send.c
+++ b/src/irc/irc-send.c
@@ -1033,9 +1033,28 @@ irc_cmd_send_names (t_irc_server *server, char *arguments)
int
irc_cmd_send_nick (t_irc_server *server, int argc, char **argv)
{
- if (argc != 1)
- return -1;
- server_sendf (server, "NICK %s\r\n", argv[0]);
+ t_irc_server *ptr_server;
+
+ if (argc == 2)
+ {
+ if (strncmp (argv[0], "-all", 4) != 0)
+ return -1;
+
+ for (ptr_server = irc_servers; ptr_server;
+ ptr_server = ptr_server->next_server)
+ {
+ if (ptr_server->is_connected)
+ server_sendf (ptr_server, "NICK %s\r\n", argv[1]);
+ }
+ }
+ else
+ {
+ if (argc == 1)
+ server_sendf (server, "NICK %s\r\n", argv[0]);
+ else
+ return -1;
+ }
+
return 0;
}