1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-08 18:13:12 +02:00

Attempt to fix fight with Gottem's auditorium module.

delayjoin was setting +d if there are invisible users still,
but it should only do that if the channel was +D earlier and
not in all cases (like if some other module is dealing with
invisible users).
This commit is contained in:
Bram Matthys
2025-11-12 17:51:17 +01:00
parent 61ebd34a1e
commit 3c0046be8b
+25 -2
View File
@@ -202,12 +202,35 @@ int moded_quit(Client *client, MessageTag *mtags, const char *comment)
// moded_kick ??
int moded_parsemode(const char *m)
{
int what = MODE_ADD;
int removed = 0;
for (; *m; m++)
{
if (*m == '+')
what = MODE_ADD;
else if (*m == '-')
what = MODE_DEL;
else if (*m == 'D')
{
if (what == MODE_DEL)
removed = 1;
else
removed = 0;
}
}
return removed;
}
int moded_chanmode(Client *client, Channel *channel, MessageTag *recv_mtags, const char *modebuf, const char *parabuf, time_t sendts, int samode)
{
long CAP_EXTENDED_JOIN = ClientCapabilityBit("extended-join");
int removed_delayed_mode = moded_parsemode(modebuf);
// Handle case where we just unset +D but have invisible users
if (!channel_is_delayed(channel) && !channel_is_post_delayed(channel) && channel_has_invisible_users(channel))
// Handle case where channel went -D but has invisible users
if (removed_delayed_mode && !channel_is_delayed(channel) && !channel_is_post_delayed(channel) && channel_has_invisible_users(channel))
set_post_delayed(channel);
// And even going from +d (back) to +D again by user request
else if (channel_is_delayed(channel) && channel_is_post_delayed(channel))