- if (channel->IsModeSet('D') != adding)
- {
- if (IS_LOCAL(source) && (channel->GetStatus(source) < STATUS_OP))
- {
- source->WriteNumeric(482, "%s %s :Only channel operators may %sset channel mode +D", source->nick, channel->name, adding ? "" : "un");
- return MODEACTION_DENY;
- }
- else
- {
- if (channel->IsModeSet('D'))
- {
- /* Make all delayed join users visible, or if an op removes +D
- * while users exist that havent spoken, they remain permenantly
- * invisible on this channel!
- */
- CUList* names = channel->GetUsers();
- for (CUListIter n = names->begin(); n != names->end(); ++n)
- Creator->OnText(n->first, channel, TYPE_CHANNEL, "", 0, empty);
- }
- channel->SetMode('D', adding);
- return MODEACTION_ALLOW;
- }
- }
- else
- {
- return MODEACTION_DENY;
- }