updates.
[silc.git] / apps / silc / silc.c
index ce9f7ee028dd58d84490abbb52132efcb99cef88..bfb4ab72b9fad180a9145e34c22153c999cc2cec 100644 (file)
@@ -267,6 +267,7 @@ SILC Secure Internet Live Conferencing, version %s\n",
 
   /* Get user information */
   silc->username = silc_get_username();
+  silc->hostname = silc_net_localhost();
   silc->realname = silc_get_real_name();
 
   /* Register all configured ciphers, PKCS and hash functions. */
@@ -274,6 +275,7 @@ SILC Secure Internet Live Conferencing, version %s\n",
   silc_client_config_register_ciphers(app->config);
   silc_client_config_register_pkcs(app->config);
   silc_client_config_register_hashfuncs(app->config);
+  silc_client_config_register_hmacs(app->config);
 
   /* Load public and private key */
   if (silc_client_load_keys(silc) == FALSE)
@@ -425,17 +427,19 @@ SILC_TASK_CALLBACK(silc_client_process_key_press)
     break;
   case CTRL('a'):
   case KEY_HOME:
+#ifdef KEY_BEG
   case KEY_BEG:
+#endif
     /* Beginning, Home */
     silc_screen_input_cursor_home(app->screen);
     break;
   case CTRL('e'):
+#ifdef KEY_END
   case KEY_END:
-    /* End */
-    silc_screen_input_cursor_end(app->screen);
-    break;
+#endif
   case KEY_LL:
     /* End */
+    silc_screen_input_cursor_end(app->screen);
     break;
   case CTRL('g'):
     /* Bell, Ctrl^g */
@@ -480,8 +484,12 @@ static int silc_client_bad_keys(unsigned char key)
   case KEY_B2:
   case KEY_C1:
   case KEY_C3:
+#ifdef KEY_UNDO
   case KEY_UNDO:
+#endif
+#ifdef KEY_EXIT
   case KEY_EXIT:
+#endif
   case '\v':           /* VT */
   case '\E':           /* we ignore ESC */
     return TRUE;
@@ -539,7 +547,7 @@ static void silc_client_process_message(SilcClientInternal app)
 
     /* Allocate command context. This and its internals must be free'd 
        by the command routine receiving it. */
-    ctx = silc_calloc(1, sizeof(*ctx));
+    ctx = silc_client_command_alloc();
     ctx->client = app->client;
     ctx->conn = app->conn;
     ctx->command = cmd;
@@ -553,13 +561,13 @@ static void silc_client_process_message(SilcClientInternal app)
 
   } else {
     /* Normal message to a channel */
-    if (len && app->conn->current_channel &&
+    if (len && app->conn && app->conn->current_channel &&
        app->conn->current_channel->on_channel == TRUE) {
       silc_print(app->client, "> %s", data);
-      silc_client_packet_send_to_channel(app->client, 
-                                        app->conn->sock,
-                                        app->conn->current_channel,
-                                        data, strlen(data), TRUE);
+      silc_client_send_channel_message(app->client, 
+                                      app->conn,
+                                      app->conn->current_channel,
+                                      data, strlen(data), TRUE);
     }
   }
 
@@ -639,7 +647,7 @@ SILC_TASK_CALLBACK(silc_client_run_commands)
 
     /* Allocate command context. This and its internals must be free'd 
        by the command routine receiving it. */
-    ctx = silc_calloc(1, sizeof(*ctx));
+    ctx = silc_client_command_alloc();
     ctx->client = client;
     ctx->conn = app->conn;
     ctx->command = cmd;