int clear_conf_resv() { struct ResvChannel *resv_cp; struct ResvChannel *next_cp; struct ResvNick *resv_np; struct ResvNick *next_np; for(resv_cp = ResvChannelList; resv_cp; resv_cp = next_cp) { next_cp = resv_cp->next; if(resv_cp->conf) delete_channel_resv(resv_cp); } for(resv_np = ResvNickList; resv_np; resv_np = next_np) { next_np = resv_np->next; if(resv_np->conf) delete_nick_resv(resv_np); } return 0; }
static void remove_resv(struct Client *source_p, const char *name) { struct ConfItem *conf = NULL; int services = 0; if(IsServices(source_p)) services = 1; if(IsChanPrefix(*name)) { struct ResvChannel *resv_p; if(resv_channel_list.head == NULL || !(resv_p = hash_find_resv(name))) { if(!services) sendto_one(source_p, ":%s NOTICE %s :A RESV does not exist for channel: %s", me.name, source_p->name, name); return; } if(resv_p->conf) { if(!services) sendto_one(source_p, ":%s NOTICE %s :The RESV for channel: %s is in ircd.conf and must be removed by hand.", me.name, source_p->name, name); return; } delete_channel_resv(resv_p); remove_conf_line(CRESV_TYPE, source_p, name, NULL); if(!services) { sendto_one(source_p, ":%s NOTICE %s :The RESV has been removed on channel: %s", me.name, source_p->name, name); sendto_realops_flags(UMODE_ALL, L_ALL, "%s has removed the RESV for channel: %s", get_oper_name(source_p), name); } } else { struct MatchItem *resv_p = NULL; if((conf = find_exact_name_conf(NRESV_TYPE, name, NULL, NULL, NULL)) == NULL) { if(!services) sendto_one(source_p, ":%s NOTICE %s :A RESV does not exist for nick: %s", me.name, source_p->name, name); return; } resv_p = map_to_conf(conf); if(resv_p->action) { if(!services) sendto_one(source_p, ":%s NOTICE %s :The RESV for nick: %s is in ircd.conf and must be removed by hand.", me.name, source_p->name, name); return; } delete_conf_item(conf); remove_conf_line(NRESV_TYPE, source_p, name, NULL); if(!services) { sendto_one(source_p, ":%s NOTICE %s :The RESV has been removed on nick: %s", me.name, source_p->name, name); sendto_realops_flags(UMODE_ALL, L_ALL, "%s has removed the RESV for nick: %s", get_oper_name(source_p), name); } } }
static void remove_resv (struct Client *source_p, char *name, int cluster) { struct ConfItem *conf; if (IsChanPrefix (*name)) { struct ResvChannel *resv_p; if (resv_channel_list.head == NULL || !(resv_p = hash_find_resv (name))) { if (!cluster) sendto_one (source_p, ":%s NOTICE %s :A RESV does not exist for channel: %s", me.name, source_p->name, name); return; } else if (resv_p->conf) { if (!cluster) sendto_one (source_p, ":%s NOTICE %s :The RESV for channel: %s is in ircd.conf and must be removed by hand.", me.name, source_p->name, name); return; } else { delete_channel_resv (resv_p); (void) remove_conf_line (CRESV_TYPE, source_p, name, NULL); if (!cluster) sendto_one (source_p, ":%s NOTICE %s :The RESV has been removed on channel: %s", me.name, source_p->name, name); sendto_realops_flags (UMODE_ALL, L_ALL, "%s has removed the RESV for channel: %s", get_oper_name (source_p), name); } } else if (clean_resv_nick (name)) { struct MatchItem *resv_p; conf = find_matching_name_conf (NRESV_TYPE, name, NULL, NULL, 0); if (conf == NULL) { if (!cluster) sendto_one (source_p, ":%s NOTICE %s :A RESV does not exist for nick: %s", me.name, source_p->name, name); return; } resv_p = (struct MatchItem *) map_to_conf (conf); if (resv_p->action) { if (!cluster) sendto_one (source_p, ":%s NOTICE %s :The RESV for nick: %s is in ircd.conf and must be removed by hand.", me.name, source_p->name, name); return; } else { delete_conf_item (conf); (void) remove_conf_line (NRESV_TYPE, source_p, name, NULL); if (!cluster) sendto_one (source_p, ":%s NOTICE %s :The RESV has been removed on nick: %s", me.name, source_p->name, name); sendto_realops_flags (UMODE_ALL, L_ALL, "%s has removed the RESV for nick: %s", get_oper_name (source_p), name); } } }