- change = mod_chanmode_dup(&cData->modes, 1);
- change->args[change->argc].mode = MODE_CHANOP;
- change->args[change->argc].u.member = AddChannelUser(chanserv, channel);
- change->argc++;
- mod_chanmode_announce(chanserv, channel, change);
- mod_chanmode_free(change);
+ if (IsOffChannel(cData))
+ {
+ mod_chanmode_announce(chanserv, channel, &cData->modes);
+ }
+ else
+ {
+ struct mod_chanmode *change = mod_chanmode_dup(&cData->modes, 1);
+ change->args[change->argc].mode = MODE_CHANOP;
+ change->args[change->argc].u.member = AddChannelUser(chanserv, channel);
+ change->argc++;
+ mod_chanmode_announce(chanserv, channel, change);
+ mod_chanmode_free(change);
+ }