Do not save locally resolved hostname for local entry but take
authorPekka Riikonen <priikone@silcnet.org>
Sat, 7 Sep 2002 15:22:20 +0000 (15:22 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Sat, 7 Sep 2002 15:22:20 +0000 (15:22 +0000)
what server sends in WHOIS.

CHANGES
lib/silcclient/client.c
lib/silcclient/idlist.c

diff --git a/CHANGES b/CHANGES
index b992c5cd6bb4737c5e3b010bbed5777ef692d582..ec4a273570a1fe90a233c30b6c6951141661ec71 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -9,6 +9,11 @@ Sat Sep  7 16:02:09 EEST 2002  Pekka Riikonen <priikone@silcnet.org>
          instead of by default using the Toolkit base version as protocol 
          version.  Affected file prepare.
 
+       * Do not set the locally resolved hostname for local client
+         entry but take what server sends.  This way the real hostname
+         is showed in WHOIS for yourself.  Affected file is
+         lib/silcclient/idlist.c and lib/silcclient/client.c.
+
 Sat Sep  7 14:22:43 CEST 2002 Lubomir Sedlacik <salo@silcnet.org>
 
        * Rewritten check for POSIX threads.  Use --with-pthreads[=DIR]
index f44aefbdd5ce2c9717683b03b03ec8e8d8947246..5c94551db4f68dab47d5482cf3815e825ff0a802 100644 (file)
@@ -1618,8 +1618,6 @@ void silc_client_receive_new_id(SilcClient client,
   conn->local_entry->nickname = conn->nickname;
   if (!conn->local_entry->username)
     conn->local_entry->username = strdup(client->username);
-  if (!conn->local_entry->hostname)
-    conn->local_entry->hostname = strdup(client->hostname);
   if (!conn->local_entry->server)
     conn->local_entry->server = strdup(conn->remote_host);
   conn->local_entry->id = conn->local_id;
index f20efc260bbb325f945cc4fb8bdd8706e00ac4ed..92b1dc37c5a354e07811583e941d76d6b8c79002 100644 (file)
@@ -646,9 +646,14 @@ void silc_client_update_client(SilcClient client,
 
   SILC_LOG_DEBUG(("Start"));
 
-  if (!client_entry->username && username)
-    silc_parse_userfqdn(username, &client_entry->username, 
+  if ((!client_entry->username || !client_entry->hostname) && username) {
+    silc_free(client_entry->username);
+    silc_free(client_entry->hostname);
+    client_entry->username = NULL;
+    client_entry->hostname = NULL;
+    silc_parse_userfqdn(username, &client_entry->username,
                        &client_entry->hostname);
+  }
   if (!client_entry->realname && userinfo)
     client_entry->realname = strdup(userinfo);
   if (!client_entry->nickname && nickname) {