/* 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 */
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;