/* Get the route to the client */
dst_sock = silc_server_get_client_route(server, packet->dst_id,
- packet->dst_id_len, NULL, &idata);
+ packet->dst_id_len, NULL,
+ &idata, NULL);
if (dst_sock)
/* Relay the packet */
silc_server_relay_packet(server, dst_sock, idata->send_key,
{
SilcSocketConnection dst_sock;
SilcIDListData idata;
+ SilcClientEntry client;
SILC_LOG_DEBUG(("Start"));
/* Get the route to the client */
dst_sock = silc_server_get_client_route(server, packet->dst_id,
- packet->dst_id_len, NULL, &idata);
+ packet->dst_id_len, NULL,
+ &idata, &client);
if (!dst_sock) {
/* Send IDENTIFY command reply with error status to indicate that
such destination ID does not exist or is invalid */
client_id, SILC_ID_CLIENT,
SILC_COMMAND_IDENTIFY,
SILC_STATUS_ERR_NO_SUCH_CLIENT_ID,
- 0, 1, 2, idp->data, idp->len);
+ 0, 0, 1, 2, idp->data, idp->len);
silc_free(client_id);
} else {
silc_server_send_command_reply(server, sock, SILC_COMMAND_IDENTIFY,
- SILC_STATUS_ERR_NO_SUCH_CLIENT_ID,
+ SILC_STATUS_ERR_NO_SUCH_CLIENT_ID, 0,
0, 1, 2, idp->data, idp->len);
}
return;
}
+ /* Check whether destination client wishes to receive private messages */
+ if (client && !(packet->flags & SILC_PACKET_FLAG_PRIVMSG_KEY) &&
+ client->mode & SILC_UMODE_BLOCK_PRIVMSG) {
+ SILC_LOG_DEBUG(("Client blocks private messages, discarding packet"));
+ return;
+ }
+
/* Send the private message */
silc_server_send_private_message(server, dst_sock, idata->send_key,
idata->hmac_send, idata->psn_send++,
/* Get the route to the client */
dst_sock = silc_server_get_client_route(server, packet->dst_id,
- packet->dst_id_len, NULL, &idata);
+ packet->dst_id_len, NULL,
+ &idata, NULL);
if (!dst_sock)
return;
/* Get the route to the client */
dst_sock = silc_server_get_client_route(server, packet->dst_id,
- packet->dst_id_len, NULL, &idata);
+ packet->dst_id_len, NULL,
+ &idata, NULL);
if (!dst_sock)
return;
/* Get the route to the client */
dst_sock = silc_server_get_client_route(server, packet->dst_id,
- packet->dst_id_len, NULL, &idata);
+ packet->dst_id_len, NULL,
+ &idata, NULL);
if (!dst_sock)
return;