chanacs_t *(*match_user)(chanacs_t *ca, user_t *mt);
bool (*can_register_channel)(myentity_t *mt);
+ bool (*allow_foundership)(myentity_t *mt);
};
E entity_chanacs_validation_vtable_t *myentity_get_chanacs_validator(myentity_t *mt);
/* chanacs */
E unsigned int myentity_count_channels_with_flagset(myentity_t *mt, unsigned int flagset);
E bool myentity_can_register_channel(myentity_t *mt);
+E bool myentity_allow_foundership(myentity_t *mt);
typedef struct {
myentity_t *entity;
return has_priv_myuser(mu, PRIV_REG_NOLIMIT);
}
+static bool linear_allow_foundership(myentity_t *mt)
+{
+ return true;
+}
+
entity_chanacs_validation_vtable_t linear_chanacs_validate = {
.match_entity = linear_chanacs_match_entity,
.can_register_channel = linear_can_register_channel,
+ .allow_foundership = linear_allow_foundership,
};
entity_chanacs_validation_vtable_t *myentity_get_chanacs_validator(myentity_t *mt)
return (myentity_count_channels_with_flagset(mt, CA_FOUNDER) < chansvs.maxchans);
}
+bool myentity_allow_foundership(myentity_t *mt)
+{
+ entity_chanacs_validation_vtable_t *vt;
+
+ return_val_if_fail(mt != NULL, false);
+
+ vt = myentity_get_chanacs_validator(mt);
+ if (vt->allow_foundership)
+ return vt->allow_foundership(mt);
+
+ return false;
+}