}
strncat(uh, entry->username, strlen(entry->username));
- if (!strchr(entry->username, '@')) {
+ if (!strchr(entry->username, '@') && entry->connection) {
strncat(uh, "@", 1);
hsock = (SilcSocketConnection)entry->connection;
len = strlen(hsock->hostname);
3, nh, strlen(nh));
} else {
strncat(uh, entry->username, strlen(entry->username));
- if (!strchr(entry->username, '@')) {
+ if (!strchr(entry->username, '@') && entry->connection) {
strncat(uh, "@", 1);
hsock = (SilcSocketConnection)entry->connection;
len = strlen(hsock->hostname);
send_reply:
/* Send the new Client ID as reply command back to client */
packet = silc_command_reply_payload_encode_va(SILC_COMMAND_NICK,
- SILC_STATUS_OK, 0, ident, 1,
- 2, nidp->data, nidp->len);
+ SILC_STATUS_OK, 0, ident, 2,
+ 2, nidp->data, nidp->len,
+ 3, nick, strlen(nick));
silc_server_packet_send(cmd->server, cmd->sock, SILC_PACKET_COMMAND_REPLY,
0, packet->data, packet->len, FALSE);
strncat(channel->invite_list, invite, len);
strncat(channel->invite_list, ",", 1);
- /* Send notify to the client that is invited to the channel */
- idp = silc_id_payload_encode(channel_id, SILC_ID_CHANNEL);
- idp2 = silc_id_payload_encode(sender->id, SILC_ID_CLIENT);
- silc_server_send_notify_dest(server, dest_sock, FALSE, dest_id,
- SILC_ID_CLIENT,
- SILC_NOTIFY_TYPE_INVITE, 3,
- idp->data, idp->len,
- channel->channel_name,
- strlen(channel->channel_name),
- idp2->data, idp2->len);
- silc_buffer_free(idp);
- silc_buffer_free(idp2);
+ if (!(dest->mode & SILC_UMODE_BLOCK_INVITE)) {
+ /* Send notify to the client that is invited to the channel */
+ idp = silc_id_payload_encode(channel_id, SILC_ID_CHANNEL);
+ idp2 = silc_id_payload_encode(sender->id, SILC_ID_CLIENT);
+ silc_server_send_notify_dest(server, dest_sock, FALSE, dest_id,
+ SILC_ID_CLIENT,
+ SILC_NOTIFY_TYPE_INVITE, 3,
+ idp->data, idp->len,
+ channel->channel_name,
+ strlen(channel->channel_name),
+ idp2->data, idp2->len);
+ silc_buffer_free(idp);
+ silc_buffer_free(idp2);
+ }
}
/* Add the client to the invite list of the channel */