]> arthur.barton.de Git - ngircd-alex.git/commitdiff
Channel_Part(): Code and comment cleanup.
authorAlexander Barton <alex@barton.de>
Thu, 24 Apr 2008 21:47:33 +0000 (23:47 +0200)
committerAlexander Barton <alex@barton.de>
Thu, 24 Apr 2008 21:47:33 +0000 (23:47 +0200)
src/ngircd/channel.c

index 35922c2b13838bd3bf20fa25192b8b9628667dde..a4eca1f18425f0b79a05ef225f129544b1f1f75d 100644 (file)
@@ -201,25 +201,33 @@ Channel_Join( CLIENT *Client, char *Name )
 } /* Channel_Join */
 
 
 } /* Channel_Join */
 
 
+/**
+ * Remove client from channel.
+ * This function lets a client lead a channel. First, the function checks
+ * if the channel exists and the client is a member of it and sends out
+ * appropriate error messages if not. The real work is done by the function
+ * Remove_Client().
+ */
 GLOBAL bool
 GLOBAL bool
-Channel_Part( CLIENT *Client, CLIENT *Origin, const char *Name, const char *Reason )
+Channel_Part(CLIENT * Client, CLIENT * Origin, const char *Name, const char *Reason)
 {
        CHANNEL *chan;
 
 {
        CHANNEL *chan;
 
-       assert( Client != NULL );
-       assert( Name != NULL );
-       assert( Reason != NULL );
+       assert(Client != NULL);
+       assert(Name != NULL);
+       assert(Reason != NULL);
 
 
-       chan = Channel_Search( Name );
-       if(( ! chan ) || ( ! Get_Cl2Chan( chan, Client )))
-       {
-               IRC_WriteStrClient( Client, ERR_NOSUCHCHANNEL_MSG, Client_ID( Client ), Name );
+       chan = Channel_Search(Name);
+       if ((!chan) || (!Get_Cl2Chan(chan, Client))) {
+               IRC_WriteStrClient(Client, ERR_NOSUCHCHANNEL_MSG,
+                                  Client_ID(Client), Name);
                return false;
        }
 
                return false;
        }
 
-       /* User aus Channel entfernen */
-       if( ! Remove_Client( REMOVE_PART, chan, Client, Origin, Reason, true)) return false;
-       else return true;
+       if (!Remove_Client(REMOVE_PART, chan, Client, Origin, Reason, true))
+               return false;
+       else
+               return true;
 } /* Channel_Part */
 
 
 } /* Channel_Part */