summaryrefslogtreecommitdiff
path: root/src/irc/core/modes.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/irc/core/modes.c')
-rw-r--r--src/irc/core/modes.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/irc/core/modes.c b/src/irc/core/modes.c
index 08ac6f8d..5f16d5ba 100644
--- a/src/irc/core/modes.c
+++ b/src/irc/core/modes.c
@@ -490,8 +490,9 @@ void channel_set_singlemode(IRC_CHANNEL_REC *channel, const char *nicks,
void channel_set_mode(IRC_SERVER_REC *server, const char *channel,
const char *mode)
{
- char *modestr, *curmode, *orig, type, prevtype;
+ IRC_CHANNEL_REC *chanrec;
GString *tmode, *targs;
+ char *modestr, *curmode, *orig, type, prevtype;
int count;
g_return_if_fail(IS_IRC_SERVER(server));
@@ -501,6 +502,10 @@ void channel_set_mode(IRC_SERVER_REC *server, const char *channel,
targs = g_string_new(NULL);
count = 0;
+ chanrec = irc_channel_find(server, channel);
+ if (chanrec != NULL)
+ channel = chanrec->name;
+
orig = modestr = g_strdup(mode);
type = '+'; prevtype = '\0';