From 406478d22432ce0b02270a766d0c8e46372f3544 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Thu, 15 Apr 2010 00:46:33 +0200 Subject: [PATCH] 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. --- modules/m_topic.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/m_topic.c b/modules/m_topic.c index 7e6206e4b..55be75ae9 100644 --- a/modules/m_topic.c +++ b/modules/m_topic.c @@ -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",