]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/numeric.c
Merge branch 'bug109-CHARCONV'
[ngircd-alex.git] / src / ngircd / numeric.c
index ba6c0254f7e32b1890723a9d3a0e0ad4fa0deb6d..4bce60fb12a947908f14118b7aa200439f4284df 100644 (file)
@@ -28,6 +28,7 @@
 #include "conn.h"
 #include "conn-func.h"
 #include "channel.h"
+#include "class.h"
 #include "irc-write.h"
 #include "lists.h"
 #include "log.h"
@@ -66,10 +67,17 @@ Announce_Channel(CLIENT *Client, CHANNEL *Chan)
                         * (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" */
@@ -194,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)
@@ -206,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 */
@@ -369,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 */