static void do_settopic(struct Client *sptr, struct Client *cptr,
struct Channel *chptr,char *topic)
{
+ struct Membership *member;
int newtopic;
+ member = find_channel_member(sptr, chptr);
/* if +n and not @'d, return an error and ignore the topic */
- if ((chptr->mode.mode & MODE_TOPICLIMIT) != 0 && !is_chan_op(sptr, chptr))
+ if ((chptr->mode.mode & MODE_TOPICLIMIT) != 0 && (!member || !IsChanOp(member)))
{
send_reply(sptr, ERR_CHANOPRIVSNEEDED, chptr->chname);
return;
}
+ if (member && IsDelayedJoin(member))
+ RevealDelayedJoin(member);
/* Note if this is just a refresh of an old topic, and don't
* send it to all the clients to save bandwidth. We still send
* it to other servers as they may have split and lost the topic.