* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
- *
- * Handlers for IRC numerics sent to the server
*/
#include "portab.h"
+/**
+ * @file
+ * Handlers for IRC numerics sent to the server
+ */
+
#include "imp.h"
#include <assert.h>
#include <stdio.h>
#include "conn.h"
#include "conn-func.h"
#include "channel.h"
+#include "class.h"
#include "irc-write.h"
#include "lists.h"
#include "log.h"
#ifdef IRCPLUS
/**
- * Synchronize invite and ban lists between servers
- * @param Client New server
+ * Synchronize invite, ban, G- and K-Line lists between servers.
+ *
+ * @param Client New server.
+ * @return CONNECTED or DISCONNECTED.
*/
static bool
Synchronize_Lists(CLIENT * Client)
assert(Client != NULL);
+ /* g-lines */
+ head = Class_GetList(CLASS_GLINE);
+ elem = Lists_GetFirst(head);
+ while (elem) {
+ if (!IRC_WriteStrClient(Client, "GLINE %s %ld :%s",
+ Lists_GetMask(elem),
+ Lists_GetValidity(elem) - time(NULL),
+ Lists_GetReason(elem)))
+ return DISCONNECTED;
+ elem = Lists_GetNext(elem);
+ }
+
c = Channel_First();
while (c) {
/* ban list */
}
#endif
+ if (!IRC_WriteStrClient(Client, "PING :%s",
+ Client_ID(Client_ThisServer())))
+ return DISCONNECTED;
+
return CONNECTED;
} /* IRC_Num_ENDOFMOTD */