]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/numeric.c
Spelling fix: "nick name" -> "nickname"
[ngircd-alex.git] / src / ngircd / numeric.c
index b0a7798b415f0004ac0d674c3bd1a0308f501aa2..3fc8c461bf73f1455731bf21f818a63455cd619d 100644 (file)
@@ -7,12 +7,15 @@
  * 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>
@@ -24,8 +27,8 @@
 #include "conf.h"
 #include "conn.h"
 #include "conn-func.h"
-#include "client.h"
 #include "channel.h"
+#include "class.h"
 #include "irc-write.h"
 #include "lists.h"
 #include "log.h"
@@ -60,14 +63,21 @@ Announce_Channel(CLIENT *Client, CHANNEL *Chan)
                assert(cl != NULL);
 
                if (njoin) {
-                       /* RFC 2813: send NJOIN with nick names and modes
+                       /* RFC 2813: send NJOIN with nicknames and modes
                         * (if user is channel operator or has voice) */
                        if (str[strlen(str) - 1] != ':')
                                strlcat(str, ",", sizeof(str));
-                       if (strchr(Channel_UserModes(Chan, cl), 'v'))
-                               strlcat(str, "+", sizeof(str));
+                       if (strchr(Channel_UserModes(Chan, cl), 'q'))
+                               strlcat(str, "~", sizeof(str));
+                       if (strchr(Channel_UserModes(Chan, cl), 'a'))
+                               strlcat(str, "&", sizeof(str));
                        if (strchr(Channel_UserModes(Chan, cl), 'o'))
                                strlcat(str, "@", sizeof(str));
+                       if (strchr(Channel_UserModes(Chan, cl), 'h'))
+                               strlcat(str, "%", sizeof(str));
+                       if (strchr(Channel_UserModes(Chan, cl), 'v'))
+                               strlcat(str, "+", sizeof(str));
+
                        strlcat(str, Client_ID(cl), sizeof(str));
 
                        /* Send the data if the buffer is "full" */
@@ -192,8 +202,10 @@ Announce_User(CLIENT * Client, CLIENT * User)
 #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)
@@ -204,6 +216,18 @@ 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 */
@@ -367,6 +391,10 @@ IRC_Num_ENDOFMOTD(CLIENT * Client, UNUSED REQUEST * Req)
        }
 #endif
 
+       if (!IRC_WriteStrClient(Client, "PING :%s",
+           Client_ID(Client_ThisServer())))
+               return DISCONNECTED;
+
        return CONNECTED;
 } /* IRC_Num_ENDOFMOTD */
 
@@ -392,12 +420,12 @@ IRC_Num_ISUPPORT(CLIENT * Client, REQUEST * Req)
                        if ((unsigned int)atol(value) == Conf_MaxNickLength - 1)
                                continue;
 
-                       /* Nick name length settings are different! */
+                       /* Nickname length settings are different! */
                        Log(LOG_ERR,
-                           "Peer uses incompatible nick name length (%d/%d)! Disconnecting ...",
+                           "Peer uses incompatible nickname length (%d/%d)! Disconnecting ...",
                            Conf_MaxNickLength - 1, atoi(value));
                        Conn_Close(Client_Conn(Client),
-                                  "Incompatible nick name length",
+                                  "Incompatible nickname length",
                                   NULL, false);
                        return DISCONNECTED;
                }