updates
authorPekka Riikonen <priikone@silcnet.org>
Thu, 16 May 2002 11:05:51 +0000 (11:05 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Thu, 16 May 2002 11:05:51 +0000 (11:05 +0000)
CHANGES
apps/irssi/src/silc/core/client_ops.c
apps/silcd/packet_send.c
lib/silcclient/client_notify.c
lib/silcclient/command.c

diff --git a/CHANGES b/CHANGES
index edd66f13574a68436723e9cfc3dadf8be9445f46..e57f70b09e0d96e617931fbfded1f4987e0e599e 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,10 @@ Thu May 16 13:05:13 CEST 2002 Pekka Riikonen <priikone@silcnet.org>
        * The nickname argument to watch notify can be optional.
          Fixes a crash in server.  Affected file silcd/packet_send.c.
 
+       * Remove the client entry from cache if the WATCH notify type
+         is KILLED, SERVER_SIGNOFF or SIGNOFF.  Affected file is
+         lib/silcclient/client_notify.c.
+
 Wed May 15 19:01:42 EEST 2002 Pekka Riikonen <priikone@silcnet.org>
 
        * Merged with Irssi CVS for Irssi SILC client.
index cd5979dd4f92cbb4e64135f751f50a6e0391d2db..6fca4be77b433bd3dc5524596ef2f96c95484eee 100644 (file)
@@ -1807,6 +1807,8 @@ typedef struct {
 void ask_passphrase_completion(const char *passphrase, void *context)
 {
   AskPassphrase p = (AskPassphrase)context;
+  if (passphrase && passphrase[0] == '\0')
+    passphrase = NULL;
   p->completion((unsigned char *)passphrase, 
                passphrase ? strlen(passphrase) : 0, p->context);
   silc_free(p);
index 14e46bd5cf53e9f82feae2a0191cd4b04a174cca..93bb71fd0de59e76a27282dcca36c0ccb866978a 100644 (file)
@@ -1423,7 +1423,7 @@ void silc_server_send_notify_watch(SilcServer server,
   silc_server_send_notify_dest(server, sock, FALSE, watcher->id,
                               SILC_ID_CLIENT, SILC_NOTIFY_TYPE_WATCH,
                               4, idp->data, idp->len,
-                              nickname, strlen(nickname),
+                              nickname, nickname ? strlen(nickname) : 0,
                               mode, sizeof(mode), 
                               type != SILC_NOTIFY_TYPE_NONE ?
                               n : NULL, sizeof(n));
index dea2e513510458159d5cc2358fdb97fa31c6be06..6eb1686ab3986bab10ec34749405b0aa2fa641a3 100644 (file)
@@ -1144,6 +1144,10 @@ void silc_client_notify_by_server(SilcClient client,
       if (tmp && notify == SILC_NOTIFY_TYPE_NICK_CHANGE &&
          !silc_hash_table_count(client_entry->channels))
        silc_client_del_client(client, conn, client_entry);
+      else if (notify == SILC_NOTIFY_TYPE_SIGNOFF ||
+              notify == SILC_NOTIFY_TYPE_SERVER_SIGNOFF ||
+              notify == SILC_NOTIFY_TYPE_KILLED)
+       silc_client_del_client(client, conn, client_entry);
     }
     break;
 
index 88f5ac40b3addbcbcfd2b7113ce30b1c9016ec2e..f7df19bf7f378fb3be9d1eadadbf3f40a8a3c262 100644 (file)
@@ -1760,7 +1760,8 @@ static void silc_client_command_oper_send(unsigned char *data,
   buffer = silc_command_payload_encode_va(SILC_COMMAND_OPER, 0, 2, 
                                          1, cmd->argv[1], 
                                          strlen(cmd->argv[1]),
-                                         2, auth->data, auth->len);
+                                         2, auth ? auth->data : NULL,
+                                         auth ? auth->len : 0);
   silc_client_packet_send(cmd->client, conn->sock, SILC_PACKET_COMMAND, NULL,
                          0, NULL, NULL, buffer->data, buffer->len, TRUE);
 
@@ -1829,7 +1830,8 @@ static void silc_client_command_silcoper_send(unsigned char *data,
   buffer = silc_command_payload_encode_va(SILC_COMMAND_SILCOPER, 0, 2, 
                                          1, cmd->argv[1], 
                                          strlen(cmd->argv[1]),
-                                         2, auth->data, auth->len);
+                                         2, auth ? auth->data : NULL,
+                                         auth ? auth->len : 0);
   silc_client_packet_send(cmd->client, conn->sock, SILC_PACKET_COMMAND, NULL,
                          0, NULL, NULL, buffer->data, buffer->len, TRUE);