]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/irc.c
This adds support for sending NOTICEs to a channel.
[ngircd-alex.git] / src / ngircd / irc.c
index 33ee22684be0dd9165a5626f2cd9d0e0f32909e2..86f5852779cf682f8b41989183cfa9a256453e1a 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: irc.c,v 1.129 2006/04/23 10:37:27 fw 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.129 2006/04/23 10:37:27 fw 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"
@@ -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;