Support IRCD 005 parameter.
authorJelmer Vernooij <jelmer@samba.org>
Tue, 30 Oct 2007 10:59:20 +0000 (11:59 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Tue, 30 Oct 2007 10:59:20 +0000 (11:59 +0100)
NEWS
src/isupport.c
src/isupport.h
src/network.c

diff --git a/NEWS b/NEWS
index 0fa1d241c52e0f41f706f4783e689884993cbd1d..bc6d46f1900b1208da2b5e4f317d1626a988f9dc 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -46,6 +46,8 @@ Ctrlproxy 3.0.4 UNRELEASED
 
     * Make connect to networks non-blocking. (#133)
 
 
     * Make connect to networks non-blocking. (#133)
 
+       * Support IRCD 005 parameter. (#160)
+
   LICENSING
 
     * CtrlProxy is now licensed under the GNU GPLv3.
   LICENSING
 
     * CtrlProxy is now licensed under the GNU GPLv3.
index a97a5ce5c4c0a10c747bd500560101a91e554baf..a2423c73bb41ca6de30ac129640bc32bf3153dd0 100644 (file)
@@ -40,6 +40,7 @@ void free_network_info(struct network_info *info)
        g_free(info->maxlist);
        g_free(info->idchan);
        g_free(info->statusmsg);
        g_free(info->maxlist);
        g_free(info->idchan);
        g_free(info->statusmsg);
+       g_free(info->ircd);
 }
 
 char *network_info_string(struct network_info *info)
 }
 
 char *network_info_string(struct network_info *info)
@@ -186,6 +187,9 @@ char *network_info_string(struct network_info *info)
        if (info->chantypes != NULL)
                fs = g_list_append(fs, g_strdup_printf("CHANTYPES=%s", info->chantypes));
 
        if (info->chantypes != NULL)
                fs = g_list_append(fs, g_strdup_printf("CHANTYPES=%s", info->chantypes));
 
+       if (info->ircd != NULL)
+               fs = g_list_append(fs, g_strdup_printf("IRCD=%s", info->ircd));
+
        if (info->chanmodes != NULL) {
                char *tmp = g_strjoinv(",", info->chanmodes);
                fs = g_list_append(fs, g_strdup_printf("CHANMODES=%s", tmp));
        if (info->chanmodes != NULL) {
                char *tmp = g_strjoinv(",", info->chanmodes);
                fs = g_list_append(fs, g_strdup_printf("CHANMODES=%s", tmp));
@@ -281,6 +285,9 @@ void network_info_parse(struct network_info *info, const char *parameter)
        } else if (!g_strcasecmp(key, "NETWORK")) {
                g_free(info->name);
                info->name = g_strdup(val);
        } else if (!g_strcasecmp(key, "NETWORK")) {
                g_free(info->name);
                info->name = g_strdup(val);
+       } else if (!g_strcasecmp(key, "IRCD")) {
+               g_free(info->ircd);
+               info->ircd = g_strdup(val);
        } else if (!g_strcasecmp(key, "NICKLEN") || !g_strcasecmp(key, "MAXNICKLEN")) {
                info->nicklen = atoi(val);
        } else if (!g_strcasecmp(key, "USERLEN")) {
        } else if (!g_strcasecmp(key, "NICKLEN") || !g_strcasecmp(key, "MAXNICKLEN")) {
                info->nicklen = atoi(val);
        } else if (!g_strcasecmp(key, "USERLEN")) {
index 69a0e556828297f8a00fb96f4ba28d2b1b9f4ffd..e7ac7ebee4b707bab1ebef274c17fd05b5f779cd 100644 (file)
@@ -103,6 +103,9 @@ struct network_info
         * PREFIX. */
        char *statusmsg;
 
         * PREFIX. */
        char *statusmsg;
 
+       /** IRCD application used on the server */
+       char *ircd;
+
        /* Maximum key length */
        int keylen;
 
        /* Maximum key length */
        int keylen;
 
index d5690c425975b9a17f2d7bdac3f9ad8f3c3ebd4b..0d7f9112df7794190336e7852f9cae217ca8efe5 100644 (file)
@@ -1120,6 +1120,7 @@ struct network *load_network(struct global *global, struct network_config *sc)
        s->config = sc;
        network_info_init(&s->info);
        s->info.name = g_strdup(s->config->name);
        s->config = sc;
        network_info_init(&s->info);
        s->info.name = g_strdup(s->config->name);
+       s->info.ircd = g_strdup("ctrlproxy");
        s->connection.pending_lines = g_queue_new();
        s->global = global;
        s->info.forced_nick_changes = TRUE; /* Forced nick changes are done by ctrlproxy */
        s->connection.pending_lines = g_queue_new();
        s->global = global;
        s->info.forced_nick_changes = TRUE; /* Forced nick changes are done by ctrlproxy */