Check server name in nick@server string. Return matching clients.
authorPekka Riikonen <priikone@silcnet.org>
Thu, 7 Jun 2007 18:29:14 +0000 (18:29 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Thu, 7 Jun 2007 18:29:14 +0000 (18:29 +0000)
CHANGES
lib/silcclient/client_entry.c
lib/silcclient/command_reply.c

diff --git a/CHANGES b/CHANGES
index cb943124c48cccab56826897fd3946e866d2d66e..c175c0c535f4b0acd9319f96e93a046d05377ca7 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,9 @@
+Thu Jun  7 21:25:31 EEST 2007  Pekka Riikonen <priikone@silcnet.org>
+
+       * Fixed silc_client_get_clients_local to check the nick's
+         server also if nick@server nickname string is given to the
+         function.  Affected file is lib/silcclient/client_entry.c.
+
 Wed Jun  6 18:33:05 EEST 2007  Pekka Riikonen <priikone@silcnet.org>
 
        * Added notify callback to silc_schedule_init which can be used to 
index 705e1cd1a74d088581be2f03b6d0ecfe8672eaff..6a92210a32c5d9a1c63332d1822a8bfd6338797f 100644 (file)
@@ -73,12 +73,13 @@ SilcDList silc_client_get_clients_local_ext(SilcClient client,
   SilcDList clients;
   SilcClientEntry entry;
   char nick[128 + 1], *nicknamec, *parsed = NULL, *format = NULL;
+  char server[256 + 1];
 
   if (!client || !conn || !nickname)
     return NULL;
 
   /* Get nickname from nickname@server string */
-  silc_parse_userfqdn(nickname, nick, sizeof(nick), NULL, 0);
+  silc_parse_userfqdn(nickname, nick, sizeof(nick), server, sizeof(server));
 
   /* Parse nickname in case it is formatted */
   if (!silc_client_nickname_parse(client, conn, (char *)nick, &parsed))
@@ -136,6 +137,14 @@ SilcDList silc_client_get_clients_local_ext(SilcClient client,
     /* Check multiple cache entries for exact match */
     while ((id_cache = silc_list_get(list))) {
       entry = id_cache->context;
+
+      /* If server was provided, find entries that either have no server
+        set or have the same server.  Ignore those that have different
+        server. */
+      if (server[0] && entry->server &&
+         !silc_utf8_strcasecmp(entry->server, server))
+       continue;
+
       if (silc_utf8_strcasecmp(entry->nickname,
                               format ? format : parsed) &&
          (!get_valid || entry->internal.valid)) {
index 9dda29d38e2c4839010a932b86c66e74c48566ee..4cb7db069b29f7d5d144ff6f2fae2549314568fc 100644 (file)
@@ -221,7 +221,7 @@ SILC_FSM_STATE(silc_client_command_reply_wait)
   /** Wait for command reply */
   silc_fsm_set_state_context(fsm, NULL);
   silc_fsm_next_later(fsm, silc_client_command_reply_timeout,
-                     cmd->cmd != SILC_COMMAND_PING ? 25 : 60, 0);
+                     cmd->cmd != SILC_COMMAND_PING ? 40 : 60, 0);
   return SILC_FSM_WAIT;
 }