summaryrefslogtreecommitdiff
path: root/src/irc/core
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-11-03 13:31:33 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-11-03 13:31:33 +0000
commit67a9ad0598bcde5af151938859d61c76ee097b54 (patch)
tree8a9726b1e0b126a48afc3de2f23d755547f97692 /src/irc/core
parent655e1110071b38a55e07083c80c481a73810c49d (diff)
downloadirssi-67a9ad0598bcde5af151938859d61c76ee097b54.zip
/OP, /DEOP, /VOICE and /DEVOICE fixed not to print glib error if used in
non-channel window. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1963 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc/core')
-rw-r--r--src/irc/core/modes.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/irc/core/modes.c b/src/irc/core/modes.c
index 25b212c2..910456ac 100644
--- a/src/irc/core/modes.c
+++ b/src/irc/core/modes.c
@@ -591,7 +591,9 @@ static void cmd_op(const char *data, IRC_SERVER_REC *server,
{
char *nicks;
- CMD_IRC_SERVER(server);
+ CMD_IRC_SERVER(server);
+ if (!IS_IRC_CHANNEL(channel))
+ cmd_return_error(CMDERR_NOT_JOINED);
nicks = get_nicks(channel, data, 0, -1);
if (nicks != NULL && *nicks != '\0')
@@ -606,6 +608,8 @@ static void cmd_deop(const char *data, IRC_SERVER_REC *server,
char *nicks;
CMD_IRC_SERVER(server);
+ if (!IS_IRC_CHANNEL(channel))
+ cmd_return_error(CMDERR_NOT_JOINED);
nicks = get_nicks(channel, data, 1, -1);
if (nicks != NULL && *nicks != '\0')
@@ -620,6 +624,8 @@ static void cmd_voice(const char *data, IRC_SERVER_REC *server,
char *nicks;
CMD_IRC_SERVER(server);
+ if (!IS_IRC_CHANNEL(channel))
+ cmd_return_error(CMDERR_NOT_JOINED);
nicks = get_nicks(channel, data, 0, 0);
if (nicks != NULL && *nicks != '\0')
@@ -634,6 +640,8 @@ static void cmd_devoice(const char *data, IRC_SERVER_REC *server,
char *nicks;
CMD_IRC_SERVER(server);
+ if (!IS_IRC_CHANNEL(channel))
+ cmd_return_error(CMDERR_NOT_JOINED);
nicks = get_nicks(channel, data, -1, 1);
if (nicks != NULL && *nicks != '\0')