static struct dict *unbursted_channels;
static const char *his_servername;
static const char *his_servercomment;
+static struct channelList dead_channels;
/* These correspond to 1 << X: 012345678901234567 */
const char irc_user_mode_chars[] = "o iw dkgn I";
* Within those sets, ordering is arbitrary.
*/
static int
-modeNode_sort(const void *pa, const void *pb)
+modeNode_sort_p10(const void *pa, const void *pb)
{
struct modeNode *a = *(struct modeNode**)pa;
struct modeNode *b = *(struct modeNode**)pb;
burst_line[pos++] = ' ';
/* sort the users for oplevel-sending purposes */
- qsort(chan->members.list, chan->members.used, sizeof(chan->members.list[0]), modeNode_sort);
+ qsort(chan->members.list, chan->members.used, sizeof(chan->members.list[0]), modeNode_sort_p10);
/* dump the users */
for (n=0; n<chan->members.used; n++) {
memset(notice_funcs, 0, sizeof(privmsg_func_t)*num_notice_funcs);
userList_init(&dead_users);
+ channelList_init(&dead_channels);
reg_del_channel_func(remove_unbursted_channel);
reg_exit_func(parse_cleanup);
}
for (i=0; i<dead_users.used; i++)
free_user(dead_users.list[i]);
dead_users.used = 0;
+ for (i=0; i<dead_channels.used; i++)
+ UnlockChannel(dead_channels.list[i]);
+ dead_channels.used = 0;
}
return res;
}
change->modes_set &= ~(MODE_SECRET);
change->modes_clear |= MODE_SECRET;
}
+ if (change->modes_clear & MODE_REGISTERED) {
+ /* Horribly cheat by using the lock/unlock semantics. */
+ LockChannel(channel);
+ channelList_append(&dead_channels, channel);
+ }
return change;
error:
mod_chanmode_free(change);
if (numeric >= num_notice_funcs) {
int newnum = numeric + 8, ii;
notice_funcs = realloc(notice_funcs, newnum*sizeof(privmsg_func_t));
- for (ii = num_privmsg_funcs; ii < newnum; ++ii)
- privmsg_funcs[ii] = NULL;
+ for (ii = num_notice_funcs; ii < newnum; ++ii)
+ notice_funcs[ii] = NULL;
num_notice_funcs = newnum;
}
if (notice_funcs[numeric])