]> arthur.barton.de Git - ngircd.git/blobdiff - src/ngircd/irc-channel.c
From: Rolf Eike Beer <eike@sf-mail.de>
[ngircd.git] / src / ngircd / irc-channel.c
index 03204d653af7072258b7844c29978f8087b902b6..139f5061ce6b8afa6777b1760593db2b076d8c40 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: irc-channel.c,v 1.40 2007/07/31 18:56:14 alex Exp $";
+static char UNUSED id[] = "$Id: irc-channel.c,v 1.40.2.2 2008/02/26 12:07:41 fw Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -79,6 +79,14 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req )
        {
                chan = NULL; flags = NULL;
 
+               if (Client_Type(Client) == CLIENT_SERVER) {
+                       flags = strchr( channame, 0x7 );
+                       if( flags ) {
+                               *flags = '\0';
+                               flags++;
+                       }
+               }
+
                /* wird der Channel neu angelegt? */
                if( Channel_Search( channame )) {
                        is_new_chan = false;
@@ -92,18 +100,6 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req )
                        is_new_chan = true;
                }
 
-               /* Hat ein Server Channel-User-Modes uebergeben? */
-               if( Client_Type( Client ) == CLIENT_SERVER )
-               {
-                       /* Channel-Flags extrahieren */
-                       flags = strchr( channame, 0x7 );
-                       if( flags )
-                       {
-                               *flags = '\0';
-                               flags++;
-                       }
-               }
-
                /* Local client? */
                if( Client_Type( Client ) == CLIENT_USER )
                {
@@ -269,8 +265,9 @@ IRC_PART( CLIENT *Client, REQUEST *Req )
        assert( Client != NULL );
        assert( Req != NULL );
 
-       /* Falsche Anzahl Parameter? */
-       if(( Req->argc > 2 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
+       if (Req->argc < 1 || Req->argc > 2)
+               return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
+                                       Client_ID(Client), Req->command);
 
        /* Wer ist der Absender? */
        if( Client_Type( Client ) == CLIENT_SERVER ) target = Client_Search( Req->prefix );
@@ -278,18 +275,11 @@ IRC_PART( CLIENT *Client, REQUEST *Req )
        if( ! target ) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->prefix );
 
        /* Channel-Namen durchgehen */
-       chan = strtok( Req->argv[0], "," );
-       while( chan )
-       {
-               if( ! Channel_Part( target, Client, chan, Req->argc > 1 ? Req->argv[1] : Client_ID( target )))
-               {
-                       /* naechsten Namen ermitteln */
-                       chan = strtok( NULL, "," );
-                       continue;
-               }
+       chan = strtok(Req->argv[0], ",");
+       while (chan) {
+               Channel_Part(target, Client, chan, Req->argc > 1 ? Req->argv[1] : Client_ID(target));
 
-               /* naechsten Namen ermitteln */
-               chan = strtok( NULL, "," );
+               chan = strtok(NULL, ",");
        }
        return CONNECTED;
 } /* IRC_PART */