summaryrefslogtreecommitdiff
path: root/src/irc/irc-send.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2005-07-19 12:19:06 +0000
committerSebastien Helleu <flashcode@flashtux.org>2005-07-19 12:19:06 +0000
commita9ca2987bbd40fc928fdab9c690f1d9a5f7b0903 (patch)
tree9c07f560a74fd5e8a0118d6e2972d27ccbc26e8c /src/irc/irc-send.c
parent220308e1fa35248180c0b36f39de2050d21c92c7 (diff)
downloadweechat-a9ca2987bbd40fc928fdab9c690f1d9a5f7b0903.zip
Commands /halfop, /voice, /deop, /dehalfop, /devoice are ok for self nick (no arg)
Diffstat (limited to 'src/irc/irc-send.c')
-rw-r--r--src/irc/irc-send.c55
1 files changed, 45 insertions, 10 deletions
diff --git a/src/irc/irc-send.c b/src/irc/irc-send.c
index c4214df0a..fa1a1bb92 100644
--- a/src/irc/irc-send.c
+++ b/src/irc/irc-send.c
@@ -484,10 +484,17 @@ irc_cmd_send_dehalfop (t_irc_server *server, int argc, char **argv)
if (BUFFER_IS_CHANNEL(gui_current_window->buffer))
{
- for (i = 0; i < argc; i++)
+ if (argc == 0)
server_sendf (server, "MODE %s -h %s\r\n",
CHANNEL(gui_current_window->buffer)->name,
- argv[i]);
+ server->nick);
+ else
+ {
+ for (i = 0; i < argc; i++)
+ server_sendf (server, "MODE %s -h %s\r\n",
+ CHANNEL(gui_current_window->buffer)->name,
+ argv[i]);
+ }
}
else
{
@@ -510,10 +517,17 @@ irc_cmd_send_deop (t_irc_server *server, int argc, char **argv)
if (BUFFER_IS_CHANNEL(gui_current_window->buffer))
{
- for (i = 0; i < argc; i++)
+ if (argc == 0)
server_sendf (server, "MODE %s -o %s\r\n",
CHANNEL(gui_current_window->buffer)->name,
- argv[i]);
+ server->nick);
+ else
+ {
+ for (i = 0; i < argc; i++)
+ server_sendf (server, "MODE %s -o %s\r\n",
+ CHANNEL(gui_current_window->buffer)->name,
+ argv[i]);
+ }
}
else
{
@@ -536,10 +550,17 @@ irc_cmd_send_devoice (t_irc_server *server, int argc, char **argv)
if (BUFFER_IS_CHANNEL(gui_current_window->buffer))
{
- for (i = 0; i < argc; i++)
+ if (argc == 0)
server_sendf (server, "MODE %s -v %s\r\n",
CHANNEL(gui_current_window->buffer)->name,
- argv[i]);
+ server->nick);
+ else
+ {
+ for (i = 0; i < argc; i++)
+ server_sendf (server, "MODE %s -v %s\r\n",
+ CHANNEL(gui_current_window->buffer)->name,
+ argv[i]);
+ }
}
else
{
@@ -577,10 +598,17 @@ irc_cmd_send_halfop (t_irc_server *server, int argc, char **argv)
if (BUFFER_IS_CHANNEL(gui_current_window->buffer))
{
- for (i = 0; i < argc; i++)
+ if (argc == 0)
server_sendf (server, "MODE %s +h %s\r\n",
CHANNEL(gui_current_window->buffer)->name,
- argv[i]);
+ server->nick);
+ else
+ {
+ for (i = 0; i < argc; i++)
+ server_sendf (server, "MODE %s +h %s\r\n",
+ CHANNEL(gui_current_window->buffer)->name,
+ argv[i]);
+ }
}
else
{
@@ -1763,10 +1791,17 @@ irc_cmd_send_voice (t_irc_server *server, int argc, char **argv)
if (BUFFER_IS_CHANNEL(gui_current_window->buffer))
{
- for (i = 0; i < argc; i++)
+ if (argc == 0)
server_sendf (server, "MODE %s +v %s\r\n",
CHANNEL(gui_current_window->buffer)->name,
- argv[i]);
+ server->nick);
+ else
+ {
+ for (i = 0; i < argc; i++)
+ server_sendf (server, "MODE %s +v %s\r\n",
+ CHANNEL(gui_current_window->buffer)->name,
+ argv[i]);
+ }
}
else
{