X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=src%2Fngircd%2Fchannel.c;fp=src%2Fngircd%2Fchannel.c;h=b7c35709d3bbdb84122c002cf4e30218c5f5c4d4;hb=b3d4cf9081fc32df969760b5b58a21954a27d073;hp=00aafe05a170102a3e22053af73861b50b14e112;hpb=1265eb15b8b3eae1a25906daaa4e38de3feb3f16;p=ngircd.git diff --git a/src/ngircd/channel.c b/src/ngircd/channel.c index 00aafe05..b7c35709 100644 --- a/src/ngircd/channel.c +++ b/src/ngircd/channel.c @@ -326,6 +326,13 @@ Channel_Kick(CLIENT *Peer, CLIENT *Target, CLIENT *Origin, const char *Name, } } + /* Check that the client to be kicked is on the specified channel */ + if (!Channel_IsMemberOf(chan, Target)) { + IRC_WriteStrClient(Origin, ERR_USERNOTINCHANNEL_MSG, + Client_ID(Origin), Client_ID(Target), Name ); + return; + } + if(Client_Type(Peer) == CLIENT_USER) { /* Channel mode 'Q' and user mode 'q' on target: nobody but * IRC Operators and servers can kick the target user */ @@ -382,13 +389,6 @@ Channel_Kick(CLIENT *Peer, CLIENT *Target, CLIENT *Origin, const char *Name, } } - /* Check that the client to be kicked is on the specified channel */ - if (!Channel_IsMemberOf(chan, Target)) { - IRC_WriteStrClient(Origin, ERR_USERNOTINCHANNEL_MSG, - Client_ID(Origin), Client_ID(Target), Name ); - return; - } - /* Kick Client from channel */ Remove_Client( REMOVE_KICK, chan, Target, Origin, Reason, true); } /* Channel_Kick */