{
SilcClientCommandPending *reply;
- /* Check whether identical pending already exists for same command,
- ident, callback and callback context. If it does then it would be
- error to register it again. */
- silc_dlist_start(conn->pending_commands);
- while ((reply = silc_dlist_get(conn->pending_commands)) != SILC_LIST_END) {
- if (reply->reply_cmd == reply_cmd && reply->ident == ident &&
- reply->callback == callback && reply->context == context)
- return;
- }
-
reply = silc_calloc(1, sizeof(*reply));
reply->reply_cmd = reply_cmd;
reply->ident = ident;
if (cmd->argv[1][0] == '*') {
if (!conn->current_channel) {
- SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO,
- "You are not on any channel");
COMMAND_ERROR(SILC_STATUS_ERR_NOT_ON_CHANNEL);
goto out;
}
}
if (!conn->current_channel) {
- SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO,
- "You are not on that channel");
COMMAND_ERROR(SILC_STATUS_ERR_NOT_ON_CHANNEL);
goto out;
}
/* Get the Channel ID of the channel */
if (!silc_idcache_find_by_name_one(conn->channel_cache, name, &id_cache)) {
- SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO,
- "You are not on that channel");
COMMAND_ERROR(SILC_STATUS_ERR_NOT_ON_CHANNEL);
goto out;
}
if (cmd->argv[1][0] == '*') {
if (!conn->current_channel) {
- SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO,
- "You are not on any channel");
COMMAND_ERROR(SILC_STATUS_ERR_NOT_ON_CHANNEL);
goto out;
}
channel = silc_client_get_channel(cmd->client, conn, name);
if (!channel) {
- SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO,
- "You are on that channel");
COMMAND_ERROR(SILC_STATUS_ERR_NOT_ON_CHANNEL);
goto out;
}
if (cmd->argv[1][0] == '*') {
if (!conn->current_channel) {
- SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO,
- "You are not on any channel");
COMMAND_ERROR(SILC_STATUS_ERR_NOT_ON_CHANNEL);
goto out;
}
channel = silc_client_get_channel(cmd->client, conn, name);
if (!channel) {
- SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO,
- "You are on that channel");
COMMAND_ERROR(SILC_STATUS_ERR_NOT_ON_CHANNEL);
goto out;
}
if (cmd->argv[1][0] == '*') {
if (!conn->current_channel) {
- SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO,
- "You are not on any channel");
COMMAND_ERROR(SILC_STATUS_ERR_NOT_ON_CHANNEL);
goto out;
}
channel = silc_client_get_channel(cmd->client, conn, name);
if (!channel) {
- SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO,
- "You are on that channel");
COMMAND_ERROR(SILC_STATUS_ERR_NOT_ON_CHANNEL);
goto out;
}
else
mode &= ~SILC_CHANNEL_UMODE_BLOCK_MESSAGES_ROBOTS;
break;
+ case 'q':
+ if (add)
+ mode |= SILC_CHANNEL_UMODE_QUIET;
+ else
+ mode &= ~SILC_CHANNEL_UMODE_QUIET;
+ break;
default:
COMMAND_ERROR(SILC_STATUS_ERR_UNKNOWN_MODE);
goto out;
if (cmd->argv[1][0] == '*') {
if (!conn->current_channel) {
- SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO,
- "You are not on any channel");
COMMAND_ERROR(SILC_STATUS_ERR_NOT_ON_CHANNEL);
goto out;
}
}
if (!conn->current_channel) {
- SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO,
- "You are not on that channel");
COMMAND_ERROR(SILC_STATUS_ERR_NOT_ON_CHANNEL);
goto out;
}
/* Get the Channel ID of the channel */
if (!silc_idcache_find_by_name_one(conn->channel_cache, name, &id_cache)) {
- SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO,
- "You are not on that channel");
COMMAND_ERROR(SILC_STATUS_ERR_NOT_ON_CHANNEL);
goto out;
}
buffer = silc_command_payload_encode_va(SILC_COMMAND_OPER, 0, 2,
1, cmd->argv[1],
strlen(cmd->argv[1]),
- 2, auth->data, auth->len);
+ 2, auth ? auth->data : NULL,
+ auth ? auth->len : 0);
silc_client_packet_send(cmd->client, conn->sock, SILC_PACKET_COMMAND, NULL,
0, NULL, NULL, buffer->data, buffer->len, TRUE);
buffer = silc_command_payload_encode_va(SILC_COMMAND_SILCOPER, 0, 2,
1, cmd->argv[1],
strlen(cmd->argv[1]),
- 2, auth->data, auth->len);
+ 2, auth ? auth->data : NULL,
+ auth ? auth->len : 0);
silc_client_packet_send(cmd->client, conn->sock, SILC_PACKET_COMMAND, NULL,
0, NULL, NULL, buffer->data, buffer->len, TRUE);
if (cmd->argv[1][0] == '*') {
if (!conn->current_channel) {
- SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO,
- "You are not on any channel");
COMMAND_ERROR(SILC_STATUS_ERR_NOT_ON_CHANNEL);
goto out;
}
channel = silc_client_get_channel(cmd->client, conn, name);
if (!channel) {
- SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO,
- "You are noton that channel");
COMMAND_ERROR(SILC_STATUS_ERR_NOT_ON_CHANNEL);
goto out;
}
if (cmd->argv[1][0] == '*') {
if (!conn->current_channel) {
- SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO,
- "You are not on any channel");
COMMAND_ERROR(SILC_STATUS_ERR_NOT_ON_CHANNEL);
goto out;
}
/* Get the channel entry */
channel = silc_client_get_channel(cmd->client, conn, name);
if (!channel) {
- SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO,
- "You are not on that channel");
COMMAND_ERROR(SILC_STATUS_ERR_NOT_ON_CHANNEL);
goto out;
}
if (cmd->argv[1][0] == '*') {
if (!conn->current_channel) {
- SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO,
- "You are not on any channel");
COMMAND_ERROR(SILC_STATUS_ERR_NOT_ON_CHANNEL);
goto out;
}