updates.
[silc.git] / apps / silc / client_ops.c
index a127140ce0b0fc7112542f2683b24431fcdb9edd..cb73029339a7706440659f7e7ad9924c670d539b 100644 (file)
@@ -49,7 +49,7 @@ void silc_channel_message(SilcClient client, SilcClientConnection conn,
                          char *sender, char *channel_name, char *msg)
 {
   /* Message from client */
-  if (!strcmp(conn->current_channel->channel_name, channel_name))
+  if (conn && !strcmp(conn->current_channel->channel_name, channel_name))
     silc_print(client, "<%s> %s", sender, msg);
   else
     silc_print(client, "<%s:%s> %s", sender, channel_name, msg);
@@ -219,6 +219,9 @@ void silc_notify(SilcClient client, SilcClientConnection conn,
     }
     return;
 
+  case SILC_NOTIFY_TYPE_CHANNEL_CHANGE:
+    break;
+
   default:
     break;
   }
@@ -284,8 +287,8 @@ void silc_command_reply(SilcClient client, SilcClientConnection conn,
                        SilcCommand command, SilcCommandStatus status, ...)
 {
   SilcClientInternal app = (SilcClientInternal)client->application;
+  SilcChannelUser chu;
   va_list vp;
-  int i;
 
   if (!success)
     return;
@@ -318,17 +321,20 @@ void silc_command_reply(SilcClient client, SilcClientConnection conn,
       }
       break;
 
-    case SILC_COMMAND_NAMES:
-      for (i = 0; i < conn->current_channel->clients_count; i++)
-       if (conn->current_channel->clients[i].client == conn->local_entry) {
+    case SILC_COMMAND_USERS:
+      silc_list_start(conn->current_channel->clients);
+      while ((chu = silc_list_get(conn->current_channel->clients)) 
+            != SILC_LIST_END) {
+       if (chu->client == conn->local_entry) {
          if (app->screen->bottom_line->mode)
            silc_free(app->screen->bottom_line->mode);
          app->screen->bottom_line->mode = 
-           silc_client_chumode_char(conn->current_channel->clients[i].mode);
+           silc_client_chumode_char(chu->mode);
          silc_screen_print_bottom_line(app->screen, 0);
          break;
        }
       break;
+      }
     }
 }
 
@@ -355,6 +361,7 @@ void silc_disconnect(SilcClient client, SilcClientConnection conn)
 
   app->screen->bottom_line->connection = NULL;
   silc_screen_print_bottom_line(app->screen, 0);
+  app->conn = NULL;
 }
 
 /* Asks passphrase from user on the input line. */