switch (chmode_flags[i])
{
- case MODE_REGONLY:
- if(rb_dlink_list_length(&service_list))
- {
- *ptr++ = (char) i;
- }
-
+ case MODE_FREETARGET:
+ case MODE_DISFORWARD:
+ if(ConfigChannel.use_forward)
+ *ptr++ = (char) i;
break;
default:
if(chmode_flags[i] != 0)
if(irccmp(banid, banptr->banstr) == 0)
{
rb_dlinkDelete(&banptr->node, list);
- free_ban(banptr);
/* invalidate the can_send() cache */
if(mode_type == CHFL_BAN || mode_type == CHFL_QUIET || mode_type == CHFL_EXCEPTION)
/* setting + */
if((dir == MODE_ADD) && !(chptr->mode.mode & mode_type))
{
+ /* if +f is disabled, ignore an attempt to set +QF locally */
+ if(!ConfigChannel.use_forward && MyClient(source_p) &&
+ (c == 'Q' || c == 'F'))
+ return;
+
chptr->mode.mode |= mode_type;
mode_changes[mode_count].letter = c;
else
mask = pretty_mask(raw_mask);
+ /* we'd have problems parsing this, hyb6 does it too
+ * also make sure it will always fit on a line with channel
+ * name etc.
+ */
+ if(strlen(mask) > IRCD_MIN(BANLEN, MODEBUFLEN - 5))
+ return;
+
/* Look for a $ after the first character.
* As the first character, it marks an extban; afterwards
* it delimits a forward channel.
forward = NULL;
}
- /* we'd have problems parsing this, hyb6 does it too
- * also make sure it will always fit on a line with channel
- * name etc.
- */
- if(strlen(mask) > IRCD_MIN(BANLEN, MODEBUFLEN - 5))
- return;
-
/* if we're adding a NEW id */
if(dir == MODE_ADD)
{
return;
}
+ if(forward != NULL && !ConfigChannel.use_forward &&
+ MyClient(source_p))
+ forward = NULL;
+
/* dont allow local clients to overflow the banlist, dont
* let remote servers set duplicate bans
*/
struct membership *msptr;
const char *forward;
+ /* if +f is disabled, ignore local attempts to set it */
+ if(!ConfigChannel.use_forward && MyClient(source_p) &&
+ (dir == MODE_ADD) && (parc > *parn))
+ return;
+
if(dir == MODE_QUERY || (dir == MODE_ADD && parc <= *parn))
{
if (!(*errors & SM_ERR_RPL_F))
mode_changes[mode_count].dir = MODE_ADD;
mode_changes[mode_count].caps = 0;
mode_changes[mode_count].nocaps = 0;
- mode_changes[mode_count].mems = ALL_MEMBERS;
+ mode_changes[mode_count].mems =
+ ConfigChannel.use_forward ? ALL_MEMBERS : ONLY_SERVERS;
mode_changes[mode_count].id = NULL;
mode_changes[mode_count++].arg = forward;
}