-
- c = Client_First( );
- while( c )
- {
- if(( Client_Type( c ) == CLIENT_SERVER ) && ( Client_Conn( c ) > NONE ) && ( c != Client_ThisServer( )) && ( c != ExceptOf ))
- {
- /* Ziel-Server gefunden */
- IRC_WriteStrClientPrefix( c, Prefix, buffer );
+
+ IRC_WriteStrServersPrefixFlag_CB(ExceptOf, Prefix, Flag,
+ cb_writeStrServersPrefixFlag, buffer);
+}
+
+/**
+ * Send a message to all the servers in the network using a specific prefix
+ * and matching a "client flag" using a callback function.
+ *
+ * @param Client The sending client, excluded while forwarding the message.
+ * @param Prefix The prefix to use.
+ * @param Flag Client flag that must be set on the target.
+ * @param callback Callback function.
+ * @param Format Format string.
+ */
+GLOBAL void
+IRC_WriteStrServersPrefixFlag_CB(CLIENT *ExceptOf, CLIENT *Prefix, char Flag,
+ void (*callback)(CLIENT *, CLIENT *, void *), void *cb_data)
+{
+ CLIENT *c;
+
+ c = Client_First();
+ while(c) {
+ if (Client_Type(c) == CLIENT_SERVER && Client_Conn(c) > NONE &&
+ c != Client_ThisServer() && c != ExceptOf) {
+ /* Found a target server, do the flags match? */
+ if (Flag == '\0' || Client_HasFlag(c, Flag))
+ callback(c, Prefix, cb_data);