/* Get route to the client */
dest_sock = silc_server_get_client_route(server, NULL, 0, dest_id, &idata);
+ if (!dest_sock) {
+ silc_server_command_send_status_reply(cmd, SILC_COMMAND_INVITE,
+ SILC_STATUS_ERR_NO_SUCH_CLIENT_ID);
+ goto out;
+ }
memset(invite, 0, sizeof(invite));
strncat(invite, dest->nickname, strlen(dest->nickname));
/* Send command reply */
tmp = silc_argument_get_arg_type(cmd->args, 1, &len);
- packet = silc_command_reply_payload_encode_va(SILC_COMMAND_INVITE,
- SILC_STATUS_OK, ident, 2,
- 2, tmp, len,
- 3, channel->invite_list,
- channel->invite_list ?
- strlen(channel->invite_list) :
- 0);
+
+ if (add || del)
+ packet =
+ silc_command_reply_payload_encode_va(SILC_COMMAND_INVITE,
+ SILC_STATUS_OK, ident, 2,
+ 2, tmp, len,
+ 3, channel->invite_list,
+ channel->invite_list ?
+ strlen(channel->invite_list) : 0);
+ else
+ packet =
+ silc_command_reply_payload_encode_va(SILC_COMMAND_INVITE,
+ SILC_STATUS_OK, ident, 1,
+ 2, tmp, len);
silc_server_packet_send(server, cmd->sock, SILC_PACKET_COMMAND_REPLY, 0,
packet->data, packet->len, FALSE);
silc_buffer_free(packet);
}
}
+ if (remote_client->data.registered == FALSE) {
+ silc_server_command_send_status_reply(cmd, SILC_COMMAND_KILL,
+ SILC_STATUS_ERR_NO_SUCH_CLIENT_ID);
+ goto out;
+ }
+
/* Get comment */
comment = silc_argument_get_arg_type(cmd->args, 2, &tmp_len2);
if (tmp_len2 > 128)
server_name = entry->server_name;
/* Send the reply */
- packet = silc_command_reply_payload_encode_va(SILC_COMMAND_INFO,
- SILC_STATUS_OK, ident, 3,
- 2, idp->data, idp->len,
- 3, server_name,
- strlen(server_name),
- 4, server_info,
- strlen(server_info));
+ if (server_info)
+ packet = silc_command_reply_payload_encode_va(SILC_COMMAND_INFO,
+ SILC_STATUS_OK, ident, 3,
+ 2, idp->data, idp->len,
+ 3, server_name,
+ strlen(server_name),
+ 4, server_info,
+ strlen(server_info));
+ else
+ packet = silc_command_reply_payload_encode_va(SILC_COMMAND_INFO,
+ SILC_STATUS_OK, ident, 2,
+ 2, idp->data, idp->len,
+ 3, server_name,
+ strlen(server_name));
silc_server_packet_send(server, cmd->sock, SILC_PACKET_COMMAND_REPLY, 0,
packet->data, packet->len, FALSE);
SilcBuffer pk;
SilcIdType id_type;
+ SILC_LOG_DEBUG(("Start"));
+
tmp = silc_argument_get_arg_type(cmd->args, 1, &tmp_len);
if (!tmp) {
silc_server_command_send_status_reply(cmd, SILC_COMMAND_GETKEY,
would be locally connected client so send the command further. */
client = silc_idlist_find_client_by_id(server->local_list,
client_id, NULL);
+ if (!client)
+ client = silc_idlist_find_client_by_id(server->global_list,
+ client_id, NULL);
if ((!client && !cmd->pending && !server->standalone) ||
- (client && !client->connection)) {
+ (client && !client->connection && !cmd->pending &&
+ !server->standalone) ||
+ (client && !client->data.public_key && !cmd->pending &&
+ !server->standalone)) {
SilcBuffer tmpbuf;
uint16 old_ident;
SilcSocketConnection dest_sock;
would be locally connected server so send the command further. */
server_entry = silc_idlist_find_server_by_id(server->local_list,
server_id, NULL);
+ if (!server_entry)
+ server_entry = silc_idlist_find_server_by_id(server->global_list,
+ server_id, NULL);
if ((!server_entry && !cmd->pending && !server->standalone) ||
- (server_entry && !server_entry->connection)) {
+ (server_entry && !server_entry->connection && !cmd->pending &&
+ !server->standalone) ||
+ (server_entry && !server_entry->data.public_key && !cmd->pending &&
+ !server->standalone)) {
SilcBuffer tmpbuf;
uint16 old_ident;