]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/irc.c
Remove duplicate Channel_FirstChannelOf().
[ngircd-alex.git] / src / ngircd / irc.c
index b0328d223355a41600fbfc7bb1131c6d9be0accd..86f5852779cf682f8b41989183cfa9a256453e1a 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: irc.c,v 1.127 2005/07/31 20:13:08 alex Exp $";
+static char UNUSED id[] = "$Id: irc.c,v 1.132 2008/01/15 22:28:14 fw Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -22,10 +22,9 @@ static char UNUSED id[] = "$Id: irc.c,v 1.127 2005/07/31 20:13:08 alex Exp $";
 #include <string.h>
 
 #include "ngircd.h"
-#include "conn.h"
 #include "resolve.h"
-#include "conf.h"
 #include "conn-func.h"
+#include "conf.h"
 #include "client.h"
 #include "channel.h"
 #include "defines.h"
@@ -151,7 +150,7 @@ IRC_KILL( CLIENT *Client, REQUEST *Req )
                }
 
                /* Kill client NOW! */
-               conn = Client_Conn( Client_NextHop( c ));
+               conn = Client_Conn( );
                Client_Destroy( c, NULL, reason, false );
                if( conn > NONE )
                        Conn_Close( conn, NULL, reason, true );
@@ -160,7 +159,7 @@ IRC_KILL( CLIENT *Client, REQUEST *Req )
                Log( LOG_NOTICE, "Client with nick \"%s\" is unknown here.", Req->argv[0] );
 
        /* Are we still connected or were we killed, too? */
-       if(( my_conn > NONE ) && ( Client_GetFromConn( my_conn )))
+       if(( my_conn > NONE ) && ( Conn_GetClient( my_conn )))
                return CONNECTED;
        else
                return DISCONNECTED;
@@ -171,6 +170,7 @@ GLOBAL bool
 IRC_NOTICE( CLIENT *Client, REQUEST *Req )
 {
        CLIENT *to, *from;
+       CHANNEL *chan;
 
        assert( Client != NULL );
        assert( Req != NULL );
@@ -190,7 +190,14 @@ IRC_NOTICE( CLIENT *Client, REQUEST *Req )
                /* Okay, Ziel ist ein User */
                return IRC_WriteStrClientPrefix( to, from, "NOTICE %s :%s", Client_ID( to ), Req->argv[1] );
        }
-       else return CONNECTED;
+       else
+       {
+               chan = Channel_Search(Req->argv[0]);
+               if (chan)
+                       return Channel_Notice(chan, from, Client, Req->argv[1]);
+       }
+
+       return CONNECTED;
 } /* IRC_NOTICE */
 
 
@@ -329,13 +336,15 @@ static char *
 Option_String( CONN_ID Idx )
 {
        static char option_txt[8];
-       int options;
+       UINT16 options;
 
-       options = Conn_Options( Idx );
+       options = Conn_Options(Idx);
 
-       strcpy( option_txt, "F" );      /* No idea what this means but the original ircd sends it ... */
+       strcpy(option_txt, "F");        /* No idea what this means, but the
+                                        * original ircd sends it ... */
 #ifdef ZLIB
-       if( options & CONN_ZIP ) strcat( option_txt, "z" );
+       if(options & CONN_ZIP)          /* zlib compression supported. */
+               strcat(option_txt, "z");
 #endif
 
        return option_txt;