X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fngircd%2Fnumeric.c;h=4bce60fb12a947908f14118b7aa200439f4284df;hb=fc39146f48f556de0a26693cd4275667d3f82ab2;hp=ba6c0254f7e32b1890723a9d3a0e0ad4fa0deb6d;hpb=03628dbeaf40a9de34b3eb6d5bf6dd34eed8248c;p=ngircd-alex.git diff --git a/src/ngircd/numeric.c b/src/ngircd/numeric.c index ba6c0254..4bce60fb 100644 --- a/src/ngircd/numeric.c +++ b/src/ngircd/numeric.c @@ -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 */