Moved silc_client_ch[u]mode[_char] to client library from silc/.
[silc.git] / apps / silcd / serverconfig.c
index 0e95bd801cc76fe7c775e9ef1981563d79232bab..fc89baced403a8e8979e93e68c18893263bab274 100644 (file)
 /*
  * $Id$
  * $Log$
+ * Revision 1.4  2000/10/06 08:10:23  priikone
+ *     Added WHOIS to send multiple replies if multiple nicknames are
+ *     found.
+ *     Added MOTD command and [motd] config section and server also sends
+ *     motd to client on connection now.
+ *     Fixed TOPIC command some more.
+ *
+ * Revision 1.3  2000/07/10 05:41:20  priikone
+ *     Added missing token to administrative information.
+ *
  * Revision 1.2  2000/07/05 06:14:01  priikone
  *     Global costemic changes.
  *
@@ -186,6 +196,8 @@ SilcConfigServerSection silc_config_server_sections[] = {
     SILC_CONFIG_SERVER_SECTION_TYPE_DENY_CONNECTION, 4 },
   { "[RedirectClient]", 
     SILC_CONFIG_SERVER_SECTION_TYPE_REDIRECT_CLIENT, 2 },
+  { "[motd]", 
+    SILC_CONFIG_SERVER_SECTION_TYPE_MOTD, 1 },
   
   { NULL, SILC_CONFIG_SERVER_SECTION_TYPE_NONE, 0 }
 };
@@ -246,6 +258,7 @@ void silc_config_server_free(SilcConfigServer config)
     silc_free(config->routers);
     silc_free(config->denied);
     silc_free(config->redirect);
+    silc_free(config->motd);
     silc_free(config);
   }
 }
@@ -579,6 +592,11 @@ int silc_config_server_parse_lines(SilcConfigServer config,
       if (!config->admin_info)
        config->admin_info = silc_calloc(1, sizeof(*config->admin_info));
 
+      /* Get location */
+      ret = silc_config_get_token(line, &config->admin_info->location);
+      if (ret < 0)
+       break;
+
       /* Get server type */
       ret = silc_config_get_token(line, &config->admin_info->server_type);
       if (ret < 0)
@@ -972,6 +990,20 @@ int silc_config_server_parse_lines(SilcConfigServer config,
       check = TRUE;
       break;
 
+    case SILC_CONFIG_SERVER_SECTION_TYPE_MOTD:
+
+      if (!config->motd)
+       config->motd = silc_calloc(1, sizeof(*config->motd));
+
+      /* Get motd file */
+      ret = silc_config_get_token(line, &config->motd->motd_file);
+      if (ret < 0)
+       break;
+
+      check = TRUE;
+      checkmask |= (1L << pc->section->type);
+      break;
+
     case SILC_CONFIG_SERVER_SECTION_TYPE_NONE:
     default:
       /* Error */