0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-21 09:58:46 +02:00

Do not allow a topic change if a user may not send to the channel

(resv, cmode +m, cmode +b, cmode +q, etc.).

This is only checked for local users.

For optimal compatibility, a failure for this reason still
returns ERR_CHANOPRIVSNEEDED.

Side effect: normal users cannot change topics of resv'ed
channels, even if they have ops, just like they already
cannot send messages. This only matters if resv_forcepart
is disabled, as the user would have been removed from the
channel otherwise.
This commit is contained in:
Jilles Tjoelker 2010-04-15 00:46:33 +02:00
parent bd44fc7b09
commit 406478d224

View file

@ -114,7 +114,10 @@ m_topic(struct Client *client_p, struct Client *source_p, int parc, const char *
return 0;
}
if((chptr->mode.mode & MODE_TOPICLIMIT) == 0 || is_chanop(msptr))
if(((chptr->mode.mode & MODE_TOPICLIMIT) == 0 ||
is_chanop(msptr)) &&
(!MyClient(source_p) ||
can_send(chptr, source_p, msptr)))
{
char topic_info[USERHOST_REPLYLEN];
rb_sprintf(topic_info, "%s!%s@%s",