updates.
authorPekka Riikonen <priikone@silcnet.org>
Sun, 16 Sep 2001 17:03:27 +0000 (17:03 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Sun, 16 Sep 2001 17:03:27 +0000 (17:03 +0000)
CHANGES
apps/irssi/src/silc/core/client_ops.c
apps/irssi/src/silc/core/silc-nicklist.c
apps/irssi/src/silc/core/silc-nicklist.h
apps/irssi/src/silc/core/silc-servers.c
apps/silcd/command.c

diff --git a/CHANGES b/CHANGES
index 3cae5b3bfaedd6529f53779af9b05fdb43703d15..bcd3fb84deba88facf5689842e979f640156d752 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -34,6 +34,11 @@ Sun Sep 16 12:32:58 EEST 2001  Pekka Riikonen <priikone@silcnet.org>
          nickname formatter doesn't set the new nick anymore to Nick@host.
          Affected file lib/silcclient/idlist.[ch].
 
+       * Now actually fixed the nickname changing on disconnection.
+         Added new function silc_change_nick to the Irssi SILC Client.
+         Affected file irssi/src/silc/core/client_ops.c,
+         irssi/src/silc/core/silc-nicklist.[ch].
+
 Sat Sep 15 13:29:17 EEST 2001  Pekka Riikonen <priikone@silcnet.org>
 
        * Check that the public key exists in the GETKEY command before
index 8bb18afd62a6464ebf2919673c95250b016a8ade..f3507b7e167151eed57d5cc08555b3eab31c7361 100644 (file)
@@ -214,6 +214,14 @@ void silc_disconnect(SilcClient client, SilcClientConnection conn)
 {
   SILC_SERVER_REC *server = conn->context;
 
+  if (server->conn) {
+    nicklist_rename_unique(SERVER(server),
+                          server->conn->local_entry, server->nick,
+                          server->conn->local_entry, 
+                          silc_client->username);
+    silc_change_nick(server, silc_client->username);
+  }
+
   server->conn->context = NULL;
   server->conn = NULL;
   server->connection_lost = TRUE;
index 9ffa113822fcda07c193dc2b7a46ee90e30f98f9..892cf4579a1a2c02c6620e0226ed1d3cbfa2ae82 100644 (file)
@@ -121,6 +121,11 @@ static void sig_connected(SILC_SERVER_REC *server)
     server->get_nick_flags = (void *) get_nick_flags;
 }
 
+void silc_change_nick(SILC_SERVER_REC *server, const char *newnick)
+{
+  server_change_nick((SERVER_REC *)server, newnick);
+}
+
 void silc_nicklist_init(void)
 {
   signal_add("server connected", (SIGNAL_FUNC) sig_connected);
index adc82e21cc14b8eb184af8e623be495d2d10d68c..b113947806a023f0b85ab8167809dadd48ebce22 100644 (file)
@@ -17,7 +17,7 @@ SILC_NICK_REC *silc_nicklist_find(SILC_CHANNEL_REC *channel,
 
 /* Check if `msg' is meant for `nick'. */
 int silc_nick_match(const char *nick, const char *msg);
-
+void silc_change_nick(SILC_SERVER_REC *server, const char *newnick);
 void silc_nicklist_init(void);
 void silc_nicklist_deinit(void);
 
index 9bc50bd4baba8ce1f12e32ac5e99791cb7bc7e9d..352430904924f99c22069619705b79fd0247a722 100644 (file)
@@ -205,16 +205,10 @@ static void sig_connected(SILC_SERVER_REC *server)
 
 static void sig_disconnected(SILC_SERVER_REC *server)
 {
-  if (!IS_SILC_SERVER(server) || server->conn == NULL)
+  if (!IS_SILC_SERVER(server))
     return;
   
-  if (server->conn->sock != NULL) {
-    nicklist_rename_unique(SERVER(server),
-                          server->conn->local_entry, server->nick,
-                          server->conn->local_entry, 
-                          silc_client->username);
-    signal_emit("message own_nick", 4, server, server->nick, server->nick, "");
-
+  if (server->conn && server->conn->sock != NULL) {
     silc_client_close_connection(silc_client, NULL, server->conn);
     
     /* SILC closes the handle */
index 567a0f9228de8c0d11b75f8bd0bc32aeb0e4e286..923270a100027ac58318751ce9ce6b461648b192 100644 (file)
@@ -122,6 +122,10 @@ static int silc_server_is_registered(SilcServer server,
                                     SilcCommand command)
 {
   SilcIDListData idata = (SilcIDListData)sock->user_data;
+
+  if (!idata)
+    return FALSE;
+
   if (idata->status & SILC_IDLIST_STATUS_REGISTERED)
     return TRUE;
 
@@ -5109,10 +5113,8 @@ SILC_SERVER_CMD_FUNC(getkey)
                                             client_id, TRUE, NULL);
     
     if ((!client && !cmd->pending && !server->standalone) ||
-       (client && !client->connection && !cmd->pending && 
-        !server->standalone) ||
-       (client && !client->data.public_key && !cmd->pending &&
-        !server->standalone)) {
+       (client && !client->connection && !cmd->pending) ||
+       (client && !client->data.public_key && !cmd->pending)) {
       SilcBuffer tmpbuf;
       uint16 old_ident;
       SilcSocketConnection dest_sock;