A user reported that the ChanServ CLOSE command was not working for
their channel, saying that the channel could not be closed.
MC_HOLD and CHAN_LOG both have the same value (1), but the former is
for flags in `struct mychan`, and the latter is for `struct channel`.
This lead me to believe that the channel was defined as a log target,
when in reality it was checking the wrong flags field and deducing
that the channel was a log target because it was held.
Check the correct flags field.
(Cherry-picked from commit
51e84e63e5b696ef39d5)
Reported-by: @hello-smile6
return;
}
- if (mc->flags & CHAN_LOG)
+ if (mc->chan != NULL && mc->chan->flags & CHAN_LOG)
{
command_fail(si, fault_noprivs, _("\2%s\2 cannot be closed."), target);
return;