More checks for not having purge timeout for global clients that
[silc.git] / apps / silcd / command_reply.c
index 64ca3abaa2f346835581670ffc80f00322d5e4b6..ecf6f3c22ff8614c6801093b7cee17d2ed9cc8c6 100644 (file)
@@ -401,6 +401,17 @@ silc_server_command_reply_whowas_save(SilcServerCommandReplyContext cmd)
                     client, 0, NULL);
   }
 
+  /* If client is global and is not on any channel then add that we'll
+     expire the entry after a while. */
+  if (global) {
+    silc_idlist_find_client_by_id(server->global_list, client->id,
+                                 FALSE, &cache);
+    if (!silc_hash_table_count(client->channels))
+      cache->expire = SILC_ID_CACHE_EXPIRE_DEF;
+    else
+      cache->expire = 0;
+  }
+
   silc_free(client_id);
 
   return TRUE;