if (!client || !conn || !nickname)
return NULL;
- /* Parse nickname if it is formatted */
+ /* Parse nickname in case it is formatted */
if (!silc_client_nickname_parse(client, conn, (char *)nickname, &parsed))
return NULL;
return NULL;
}
+ SILC_LOG_DEBUG(("Found %d clients", silc_dlist_count(clients)));
+
silc_dlist_start(clients);
return clients;
}
SilcBuffer idp;
SilcUInt16 cmd_ident;
- if (!client || !conn | !client_id)
+ if (!client || !conn | !client_id) {
+ SILC_LOG_ERROR(("Missing arguments to "
+ "silc_client_get_clients_by_id_resolve call"));
return 0;
+ }
SILC_LOG_DEBUG(("Resolve client by ID (%s)",
silc_id_render(client_id, SILC_ID_CLIENT)));
void *context)
{
SilcClientGetClientInternal i;
- char userhost[768 + 1];
+ char nick[128 + 1], serv[256 + 1], userhost[768 + 1], *parsed = NULL;
int len;
SILC_LOG_DEBUG(("Resolve client by %s command",
silc_get_command_name(command)));
- if (!client || !conn)
+ if (!client || !conn) {
+ SILC_LOG_ERROR(("Missing arguments to silc_client_get_clients call"));
return 0;
- if (!nickname && !attributes)
+ }
+ if (!nickname && !attributes) {
+ SILC_LOG_ERROR(("Missing arguments to silc_client_get_clients call"));
return 0;
+ }
+
+ /* Parse server name from the nickname if set */
+ if (silc_parse_userfqdn(nickname, nick, sizeof(nick),
+ serv, sizeof(serv) == 2))
+ server = (const char *)serv;
+ nickname = (const char *)nick;
+
+ /* Parse nickname in case it is formatted */
+ if (silc_client_nickname_parse(client, conn, (char *)nickname, &parsed))
+ nickname = (const char *)parsed;
i = silc_calloc(1, sizeof(*i));
- if (!i)
+ if (!i) {
+ silc_free(parsed);
return 0;
+ }
i->clients = silc_dlist_init();
if (!i->clients) {
+ silc_free(parsed);
silc_free(i);
return 0;
}
} else if (nickname) {
silc_strncat(userhost, sizeof(userhost) - 1, nickname, strlen(nickname));
}
+ silc_free(parsed);
/* Send the command */
if (command == SILC_COMMAND_IDENTIFY)