diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/fe-common/irc/fe-irc-commands.c | 9 | ||||
-rw-r--r-- | src/irc/core/bans.c | 10 | ||||
-rw-r--r-- | src/irc/core/irc-commands.c | 4 |
3 files changed, 10 insertions, 13 deletions
diff --git a/src/fe-common/irc/fe-irc-commands.c b/src/fe-common/irc/fe-irc-commands.c index 6f208447..c9a9016e 100644 --- a/src/fe-common/irc/fe-irc-commands.c +++ b/src/fe-common/irc/fe-irc-commands.c @@ -211,9 +211,6 @@ static void bans_show_channel(IRC_CHANNEL_REC *channel, IRC_SERVER_REC *server) GSList *tmp; int counter; - if (!channel->synced) - cmd_return_error(CMDERR_CHAN_NOT_SYNCED); - if (channel->banlist == NULL) { printformat(server, channel->visible_name, MSGLEVEL_CLIENTNOTICE, @@ -265,9 +262,9 @@ static void cmd_ban(const char *data, IRC_SERVER_REC *server, if (*channel != '\0' && strcmp(channel, "*") != 0) chanrec = irc_channel_find(server, channel); - if (chanrec == NULL) { - /* not joined to such channel, - but ask ban lists from server */ + if (chanrec == NULL || !chanrec->synced) { + /* not joined to such channel or not yet synced, + ask ban lists from server */ bans_ask_channel(channel, server, item); } else { bans_show_channel(chanrec, server); diff --git a/src/irc/core/bans.c b/src/irc/core/bans.c index e980aa43..2cdd788b 100644 --- a/src/irc/core/bans.c +++ b/src/irc/core/bans.c @@ -51,7 +51,11 @@ char *ban_get_mask(IRC_CHANNEL_REC *channel, const char *nick, int ban_type) g_return_val_if_fail(nick != NULL, NULL); rec = nicklist_find(CHANNEL(channel), nick); - if (rec == NULL || rec->host == NULL) return NULL; + if (rec == NULL) return NULL; + if (rec->host == NULL) { + g_warning("channel %s is not synced, using nick ban for %s", channel->name, nick); + return g_strdup_printf("%s!*@*", nick); + } if (ban_type <= 0) ban_type = default_ban_type; @@ -158,6 +162,8 @@ void ban_remove(IRC_CHANNEL_REC *channel, const char *bans) } if (rec != NULL) g_string_sprintfa(str, "%s ", rec->ban); + else if (!channel->synced) + g_warning("channel %s is not synced", channel->name); } } g_strfreev(banlist); @@ -191,8 +197,6 @@ static void command_set_ban(const char *data, IRC_SERVER_REC *server, chanrec = irc_channel_find(server, channel); if (chanrec == NULL) cmd_param_error(CMDERR_CHAN_NOT_FOUND); - if (!chanrec->wholist) - cmd_param_error(CMDERR_CHAN_NOT_SYNCED); if (set) ban_set(chanrec, nicks, ban_type); diff --git a/src/irc/core/irc-commands.c b/src/irc/core/irc-commands.c index a6103f36..e51aa111 100644 --- a/src/irc/core/irc-commands.c +++ b/src/irc/core/irc-commands.c @@ -682,8 +682,6 @@ static void cmd_kickban(const char *data, IRC_SERVER_REC *server, chanrec = irc_channel_find(server, channel); if (chanrec == NULL) cmd_param_error(CMDERR_CHAN_NOT_FOUND); - if (!chanrec->wholist) - cmd_param_error(CMDERR_CHAN_NOT_SYNCED); nicklist = g_strsplit(nicks, ",", -1); spacenicks = g_strjoinv(" ", nicklist); @@ -761,8 +759,6 @@ static void cmd_knockout(const char *data, IRC_SERVER_REC *server, if (!IS_IRC_CHANNEL(channel)) cmd_return_error(CMDERR_NOT_JOINED); - if (!channel->wholist) - cmd_return_error(CMDERR_CHAN_NOT_SYNCED); if (i_isdigit(*data)) { /* first argument is the timeout */ |