#include "portab.h"
-static char UNUSED id[] = "$Id: irc-server.c,v 1.41 2006/10/06 21:32:58 fw Exp $";
+static char UNUSED id[] = "$Id: irc-server.c,v 1.43 2006/12/07 17:57:20 fw Exp $";
#include "imp.h"
#include <assert.h>
#include "irc-server.h"
+#ifdef IRCPLUS
+static bool
+Synchronize_Lists( CLIENT *Client )
+{
+ CHANNEL *c;
+ struct list_head *head;
+ struct list_elem *elem;
+
+ assert( Client != NULL );
+
+ c = Channel_First();
+
+ while (c) {
+ head = Channel_GetListBans(c);
+
+ elem = Lists_GetFirst(head);
+ while (elem) {
+ if( ! IRC_WriteStrClient( Client, "MODE %s +b %s",
+ Channel_Name(c), Lists_GetMask(elem)))
+ {
+ return false;
+ }
+ elem = Lists_GetNext(elem);
+ }
+
+ head = Channel_GetListInvites(c);
+ elem = Lists_GetFirst(head);
+ while (elem) {
+ if( ! IRC_WriteStrClient( Client, "MODE %s +I %s",
+ Channel_Name( c ), Lists_GetMask(elem)))
+ {
+ return false;
+ }
+ elem = Lists_GetNext(elem);
+ }
+ c = Channel_Next(c);
+ }
+ return true;
+}
+#endif
+
+
+
+
/**
* Handler for the IRC command "SERVER".
* See RFC 2813 section 4.1.2.
if (Client_Type(Client) == CLIENT_GOTPASS) {
/* We got a PASS command from the peer, and now a SERVER
* command: the peer tries to register itself as a server. */
- Log(LOG_DEBUG,
- "Connection %d: got SERVER command (new server link) ...",
- Client_Conn(Client));
+ LogDebug("Connection %d: got SERVER command (new server link) ...",
+ Client_Conn(Client));
/* Falsche Anzahl Parameter? */
if(( Req->argc != 2 ) && ( Req->argc != 3 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
"Synchronizing INVITE- and BAN-lists ...");
#endif
/* Synchronize INVITE- and BAN-lists */
- if (! Lists_SendInvites(Client))
- return DISCONNECTED;
- if (! Lists_SendBans(Client))
+ if (!Synchronize_Lists(Client))
return DISCONNECTED;
}
#endif