summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-06-05 12:20:46 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-06-05 12:20:46 +0000
commitd1e55d91b7da5d08ed0c823d8fdc785175deb8f8 (patch)
treeef5a4c0bf164b7f54787fbd3d59ad61519189ddc /src
parent2013e4b004c8d6b3e103ba67e272445aea0e2cfb (diff)
downloadirssi-d1e55d91b7da5d08ed0c823d8fdc785175deb8f8.zip
"/MODE !channel" should send the full name to server
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2838 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r--src/irc/core/modes.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/irc/core/modes.c b/src/irc/core/modes.c
index 5f16d5ba..946b533b 100644
--- a/src/irc/core/modes.c
+++ b/src/irc/core/modes.c
@@ -716,6 +716,7 @@ static void cmd_devoice(const char *data, IRC_SERVER_REC *server,
static void cmd_mode(const char *data, IRC_SERVER_REC *server,
IRC_CHANNEL_REC *channel)
{
+ IRC_CHANNEL_REC *chanrec;
char *target, *mode;
void *free_arg;
@@ -738,9 +739,13 @@ static void cmd_mode(const char *data, IRC_SERVER_REC *server,
}
if (*target == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
- if (*mode == '\0')
+ if (*mode == '\0') {
+ chanrec = irc_channel_find(server, target);
+ if (chanrec != NULL)
+ target = chanrec->name;
+
irc_send_cmdv(server, "MODE %s", target);
- else if (ischannel(*target))
+ } else if (ischannel(*target))
channel_set_mode(server, target, mode);
else {
if (g_strcasecmp(target, server->nick) == 0) {