]> jfr.im git - irc/freenode/ircd-seven.git/commitdiff
Do not allow a topic change if a user may not send to the channel
authorJilles Tjoelker <redacted>
Wed, 14 Apr 2010 22:46:33 +0000 (00:46 +0200)
committerJilles Tjoelker <redacted>
Wed, 14 Apr 2010 22:46:33 +0000 (00:46 +0200)
(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

index 7e6206e4b66feaac4ebdf1a5296636c926c7c003..55be75ae95970d25f6aa7d28cd71eb01883ff7ff 100644 (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",