Fixed -C option to work on command line. Bug #16.
authorPekka Riikonen <priikone@silcnet.org>
Sat, 7 Sep 2002 12:08:32 +0000 (12:08 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Sat, 7 Sep 2002 12:08:32 +0000 (12:08 +0000)
CHANGES
apps/irssi/src/silc/core/silc-channels.c
apps/irssi/src/silc/core/silc-core.c

diff --git a/CHANGES b/CHANGES
index 3c734fc7f25d965fff9a012be1dee2c9849acc93..fa532993d0e86a92d914873f3f60d33d382a641e 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,10 @@
+Sat Sep  7 15:08:13 EEST 2002 Pekka Riikonen <priikone@silcnet.org>
+
+       * Moved -C option parsing in Irssi SILC client at same time
+         as other options.  The UI was initialized earlier and caused
+         problems on command line.  Bug #16.  Affected file is
+         irssi/src/silc/core/silc-core.c.
+
 Mon Sep  2 23:00:30 CEST 2002 Johnny Mnemonic <johnny@themnemonic.org>
 
        * Added global variable silc_log_timestamp that tells silclog
index a9b8c9539affadfc679b0158a787348144e3b549..f2ed992655fc3a5b352fe943c0fb08b6866807d5 100644 (file)
@@ -175,7 +175,7 @@ static void command_part(const char *data, SILC_SERVER_REC *server,
   chanrec->left = TRUE;
   silc_command_exec(server, "LEAVE", chanrec->name);
   signal_stop();
-  
+
   channel_destroy(CHANNEL(chanrec));
 }
 
index fedb21061e5fdc2a65f56e10644cd19b10fed4d0..f34400e94b7ef76085435de48b2d329aa2135350 100644 (file)
@@ -302,11 +302,8 @@ void silc_opt_callback(poptContext con,
     sleep(1);
 #endif
   }
-}
 
-static void sig_init_read_settings(void)
-{
-  if (opt_create_keypair) {
+  if (strcmp(opt->longName, "create-key-pair") == 0) {
     /* Create new key pair and exit */
     silc_cipher_register_default();
     silc_pkcs_register_default();
@@ -336,12 +333,7 @@ void silc_core_init(void)
       "List supported PKCSs", NULL },
     { "debug", 'd', POPT_ARG_STRING, NULL, 0,
       "Enable debugging", "STRING" },
-    { NULL, '\0', 0, NULL }
-  };
-
-  static struct poptOption options[] = {
-    { NULL, '\0', POPT_ARG_INCLUDE_TABLE, silc_options, 0, NULL, NULL },
-    { "create-key-pair", 'C', POPT_ARG_NONE, &opt_create_keypair, 0,
+    { "create-key-pair", 'C', POPT_ARG_NONE, NULL, 0,
       "Create new public key pair", NULL },
     { "pkcs", 0, POPT_ARG_STRING, &opt_pkcs, 0,
       "Set the PKCS of the public key pair (-C)", "PKCS" },
@@ -354,8 +346,7 @@ void silc_core_init(void)
   SilcClientParams params;
   const char *def_cipher, *def_hash, *def_hmac;
 
-  args_register(options);
-  signal_add("irssi init read settings", (SIGNAL_FUNC) sig_init_read_settings);
+  args_register(silc_options);
 
   /* Settings */
   settings_add_bool("server", "skip_motd", FALSE);
@@ -464,8 +455,6 @@ void silc_core_deinit(void)
   if (idletag != -1) {
     signal_emit("chat protocol deinit", 1,
                chat_protocol_find("SILC"));
-    signal_remove("irssi init read settings", 
-                 (SIGNAL_FUNC) sig_init_read_settings);
 #ifdef SILC_DEBUG
     signal_remove("setup changed", (SIGNAL_FUNC) sig_debug_setup_changed);
 #endif