Commit Diff


commit - 938abb0236cece1a05f713eb96fa0b9dd4cf56c3
commit + 3010f0341498d7bfd1757e89c50ea42282339748
blob - 5cc58006a115ad968efb4a04fbfd393ef306f785
blob + b53aeced1f5e9a840e44e2ac3f761cb1ebfda61c
--- src/ngircd/irc-write.c
+++ src/ngircd/irc-write.c
@@ -9,7 +9,7 @@
  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
  * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
  *
- * $Id: irc-write.c,v 1.5 2002/05/30 16:52:21 alex Exp $
+ * $Id: irc-write.c,v 1.6 2002/09/03 23:56:06 alex Exp $
  *
  * irc-write.c: IRC-Texte und Befehle ueber Netzwerk versenden
  */
@@ -21,6 +21,7 @@
 #include <assert.h>
 #include <stdarg.h>
 #include <stdio.h>
+#include <string.h>
 
 #include "conn.h"
 #include "client.h"
@@ -242,8 +243,39 @@ IRC_WriteStrServersPrefix( CLIENT *ExceptOf, CLIENT *P
 #else
 GLOBAL VOID
 IRC_WriteStrServersPrefix( ExceptOf, Prefix, Format, va_alist )
+CLIENT *ExceptOf;
+CLIENT *Prefix;
+CHAR *Format;
+va_dcl
+#endif
+{
+	CHAR buffer[1000];
+	va_list ap;
+
+	assert( Format != NULL );
+	assert( Prefix != NULL );
+
+#ifdef PROTOTYPES
+	va_start( ap, Format );
+#else
+	va_start( ap );
+#endif
+	vsnprintf( buffer, 1000, Format, ap );
+	va_end( ap );
+
+	return IRC_WriteStrServersPrefixFlag( ExceptOf, Prefix, '\0', buffer );
+} /* IRC_WriteStrServersPrefix */
+	
+
+#ifdef PROTOTYPES
+GLOBAL VOID
+IRC_WriteStrServersPrefixFlag( CLIENT *ExceptOf, CLIENT *Prefix, CHAR Flag, CHAR *Format, ... )
+#else
+GLOBAL VOID
+IRC_WriteStrServersPrefixFlag( ExceptOf, Prefix, Flag, Format, va_alist )
 CLIENT *ExceptOf;
 CLIENT *Prefix;
+CHAR Flag;
 CHAR *Format;
 va_dcl
 #endif
@@ -268,12 +300,12 @@ va_dcl
 	{
 		if(( Client_Type( c ) == CLIENT_SERVER ) && ( Client_Conn( c ) > NONE ) && ( c != Client_ThisServer( )) && ( c != ExceptOf ))
 		{
-			/* Ziel-Server gefunden */
-			IRC_WriteStrClientPrefix( c, Prefix, buffer );
+			/* Ziel-Server gefunden. Nun noch pruefen, ob Flags stimmen */
+			if(( Flag == '\0' ) || ( strchr( Client_Flags( c ), Flag ) != NULL )) IRC_WriteStrClientPrefix( c, Prefix, buffer );
 		}
 		c = Client_Next( c );
 	}
-} /* IRC_WriteStrServersPrefix */
+} /* IRC_WriteStrServersPrefixFlag */
 
 
 #ifdef PROTOTYPES
blob - 4b73f9ab5798dda07ee0e84cc0602fad06242f9d
blob + df78882dea6ae724ab30aecae8697275193dceca
--- src/ngircd/irc-write.h
+++ src/ngircd/irc-write.h
@@ -9,7 +9,7 @@
  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
  * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
  *
- * $Id: irc-write.h,v 1.3 2002/05/27 13:09:27 alex Exp $
+ * $Id: irc-write.h,v 1.4 2002/09/03 23:56:06 alex Exp $
  *
  * irc-write.h: IRC-Texte und Befehle ueber Netzwerk versenden (Header)
  */
@@ -27,6 +27,7 @@ GLOBAL BOOLEAN IRC_WriteStrChannelPrefix PARAMS((CLIEN
 
 GLOBAL VOID IRC_WriteStrServers PARAMS((CLIENT *ExceptOf, CHAR *Format, ... ));
 GLOBAL VOID IRC_WriteStrServersPrefix PARAMS((CLIENT *ExceptOf, CLIENT *Prefix, CHAR *Format, ... ));
+GLOBAL VOID IRC_WriteStrServersPrefixFlag PARAMS((CLIENT *ExceptOf, CLIENT *Prefix, CHAR Flag, CHAR *Format, ... ));
 
 GLOBAL BOOLEAN IRC_WriteStrRelatedPrefix PARAMS((CLIENT *Client, CLIENT *Prefix, BOOLEAN Remote, CHAR *Format, ... ));