[srvx-commits] CVS: services/src opserv.c,1.339,1.340
Brought to you by:
entrope
From: Entrope <en...@us...> - 2003-10-03 02:45:31
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv29038 Modified Files: opserv.c Log Message: Clear bad_channel flag when an exemption is added or a badword is removed Index: opserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/opserv.c,v retrieving revision 1.339 retrieving revision 1.340 diff -C2 -r1.339 -r1.340 *** opserv.c 30 Sep 2003 17:47:08 -0000 1.339 --- opserv.c 3 Oct 2003 02:45:26 -0000 1.340 *************** *** 420,424 **** strcpy(buffer, "Modes: "); irc_make_chanmode(channel, buffer+strlen(buffer)); ! if (channel->bad_channel) strcat(buffer, "; bad-word channel"); opserv_notice(user, "%s", buffer); if (channel->topic_time > 1) { --- 420,425 ---- strcpy(buffer, "Modes: "); irc_make_chanmode(channel, buffer+strlen(buffer)); ! if (channel->bad_channel) ! strcat(buffer, "; bad-word channel"); opserv_notice(user, "%s", buffer); if (channel->topic_time > 1) { *************** *** 1766,1774 **** dict_find(opserv_exempt_channels, name, &found); ! if (found) return 0; ! for (found=0; found<opserv_bad_words->used; ++found) { ! if (irccasestr(name, opserv_bad_words->list[found])) return 1; ! } return 0; --- 1767,1776 ---- dict_find(opserv_exempt_channels, name, &found); ! if (found) ! return 0; ! for (found=0; found<opserv_bad_words->used; ++found) ! if (irccasestr(name, opserv_bad_words->list[found])) ! return 1; return 0; *************** *** 1952,1955 **** --- 1954,1958 ---- static OPSERV_FUNC(cmd_delbad) { + dict_iterator_t it; unsigned int nn; *************** *** 1957,1960 **** --- 1960,1969 ---- if (!irccasecmp(opserv_bad_words->list[nn], argv[1])) { string_list_delete(opserv_bad_words, nn); + for (it = dict_first(channels); it; it = iter_next(it)) { + channel = iter_data(it); + if (irccasestr(channel->name, argv[1]) + && !opserv_bad_channel(channel->name)) + channel->bad_channel = 0; + } opserv_notice(user, OSMSG_REMOVED_BAD, argv[1]); return 1; *************** *** 1977,1980 **** --- 1986,1992 ---- } dict_insert(opserv_exempt_channels, strdup(chanName), NULL); + channel = GetChannel(chanName); + if (channel) + channel->bad_channel = 0; reply(OSMSG_ADDED_EXEMPTION, chanName); return 1; |