command_reply(cmd->client, cmd->sock->user_data, cmd->payload, \
FALSE, silc_command_get(cmd->payload), status)
+#define SAY cmd->client->internal->ops->say
+
/* All functions that call the COMMAND_CHECK_STATUS or the
COMMAND_CHECK_STATUS_LIST macros must have out: goto label. */
SILC_GET16_MSB(status, silc_argument_get_arg_type(cmd->args, 1, NULL));
if (status != SILC_STATUS_OK) {
- cmd->client->internal->ops->say(
- cmd->client,
- conn, SILC_CLIENT_MESSAGE_ERROR,
- "Cannot set nickname: %s",
- silc_client_command_status_message(status));
+ SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
+ "Cannot set nickname: %s", silc_client_command_status_message(status));
COMMAND_REPLY_ERROR;
goto out;
}
argc = silc_argument_get_arg_num(cmd->args);
if (argc < 2 || argc > 2) {
- cmd->client->internal->ops->say(
- cmd->client,
- conn, SILC_CLIENT_MESSAGE_ERROR,
- "Cannot set nickname: bad reply to command");
+ SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
+ "Cannot set nickname: bad reply to command");
COMMAND_REPLY_ERROR;
goto out;
}
SILC_GET16_MSB(status, silc_argument_get_arg_type(cmd->args, 1, NULL));
if (status != SILC_STATUS_OK) {
- cmd->client->internal->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
- "%s", silc_client_command_status_message(status));
+ SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
+ "%s", silc_client_command_status_message(status));
COMMAND_REPLY_ERROR;
goto out;
}
tmp = silc_argument_get_arg_type(cmd->args, 1, NULL);
SILC_GET16_MSB(status, tmp);
if (status != SILC_STATUS_OK) {
- cmd->client->internal->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
- "%s", silc_client_command_status_message(status));
+ SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
+ "%s", silc_client_command_status_message(status));
COMMAND_REPLY_ERROR;
goto out;
}
SILC_GET16_MSB(status, silc_argument_get_arg_type(cmd->args, 1, NULL));
if (status != SILC_STATUS_OK) {
- cmd->client->internal->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
- "%s", silc_client_command_status_message(status));
+ SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
+ "%s", silc_client_command_status_message(status));
COMMAND_REPLY_ERROR;
goto out;
}
tmp = silc_argument_get_arg_type(cmd->args, 1, NULL);
SILC_GET16_MSB(status, tmp);
if (status != SILC_STATUS_OK) {
- cmd->client->internal->ops->say(
- cmd->client, conn,
- SILC_CLIENT_MESSAGE_ERROR,
- "%s",
- silc_client_command_status_message(status));
+ SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR, "%s",
+ silc_client_command_status_message(status));
COMMAND_REPLY_ERROR;
goto out;
}
SILC_GET16_MSB(status, silc_argument_get_arg_type(cmd->args, 1, NULL));
if (status != SILC_STATUS_OK) {
- cmd->client->internal->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
- "%s", silc_client_command_status_message(status));
+ SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
+ "%s", silc_client_command_status_message(status));
COMMAND_REPLY_ERROR;
goto out;
}
continue;
if (SILC_ID_SERVER_COMPARE(conn->ping[i].dest_id, id)) {
diff = curtime - conn->ping[i].start_time;
- cmd->client->internal->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO,
- "Ping reply from %s: %d second%s",
- conn->ping[i].dest_name, diff,
- diff == 1 ? "" : "s");
+ SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO,
+ "Ping reply from %s: %d second%s",
+ conn->ping[i].dest_name, diff,
+ diff == 1 ? "" : "s");
conn->ping[i].start_time = 0;
silc_free(conn->ping[i].dest_id);
SILC_GET16_MSB(status, silc_argument_get_arg_type(cmd->args, 1, NULL));
if (status != SILC_STATUS_OK) {
if (status != SILC_STATUS_ERR_USER_ON_CHANNEL)
- cmd->client->internal->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
- "%s", silc_client_command_status_message(status));
+ SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
+ "%s", silc_client_command_status_message(status));
COMMAND_REPLY_ERROR;
goto out;
}
argc = silc_argument_get_arg_num(cmd->args);
if (argc < 7 || argc > 14) {
- cmd->client->internal->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
- "Cannot join channel: Bad reply packet");
+ SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
+ "Cannot join channel: Bad reply packet");
COMMAND_REPLY_ERROR;
goto out;
}
/* Get channel name */
tmp = silc_argument_get_arg_type(cmd->args, 2, NULL);
if (!tmp) {
- cmd->client->internal->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
- "Cannot join channel: Bad reply packet");
+ SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
+ "Cannot join channel: Bad reply packet");
COMMAND_REPLY_ERROR;
goto out;
}
/* Get Channel ID */
tmp = silc_argument_get_arg_type(cmd->args, 3, &len);
if (!tmp) {
- cmd->client->internal->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
- "Cannot join channel: Bad reply packet");
+ SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
+ "Cannot join channel: Bad reply packet");
COMMAND_REPLY_ERROR;
silc_free(channel_name);
goto out;
hmac = silc_argument_get_arg_type(cmd->args, 11, NULL);
if (hmac) {
if (!silc_hmac_alloc(hmac, NULL, &channel->hmac)) {
- cmd->client->internal->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
- "Cannot join channel: Unsupported HMAC `%s'",
- hmac);
+ SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
+ "Cannot join channel: Unsupported HMAC `%s'", hmac);
COMMAND_REPLY_ERROR;
silc_free(channel_name);
goto out;
tmp = silc_argument_get_arg_type(cmd->args, 1, NULL);
SILC_GET16_MSB(status, tmp);
if (status != SILC_STATUS_OK) {
- cmd->client->internal->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
- "%s", silc_client_command_status_message(status));
+ SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
+ "%s", silc_client_command_status_message(status));
COMMAND_REPLY_ERROR;
return;
}
if (i == 2)
line[0] = ' ';
- cmd->client->internal->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO,
- "%s", line);
+ SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, "%s", line);
if (!strlen(cp))
break;
tmp = silc_argument_get_arg_type(cmd->args, 1, NULL);
SILC_GET16_MSB(status, tmp);
if (status != SILC_STATUS_OK) {
- cmd->client->internal->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
- "%s", silc_client_command_status_message(status));
+ SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
+ "%s", silc_client_command_status_message(status));
COMMAND_REPLY_ERROR;
goto out;
}
SILC_GET16_MSB(status, silc_argument_get_arg_type(cmd->args, 1, NULL));
if (status != SILC_STATUS_OK) {
- cmd->client->internal->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
- "%s", silc_client_command_status_message(status));
+ SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
+ "%s", silc_client_command_status_message(status));
COMMAND_REPLY_ERROR;
goto out;
}
SILC_GET16_MSB(status, silc_argument_get_arg_type(cmd->args, 1, NULL));
if (status != SILC_STATUS_OK) {
- cmd->client->internal->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
- "%s", silc_client_command_status_message(status));
+ SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
+ "%s", silc_client_command_status_message(status));
COMMAND_REPLY_ERROR;
goto out;
}
tmp = silc_argument_get_arg_type(cmd->args, 1, NULL);
SILC_GET16_MSB(status, tmp);
if (status != SILC_STATUS_OK) {
- cmd->client->internal->ops->say(
- cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
- "%s", silc_client_command_status_message(status));
+ SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
+ "%s", silc_client_command_status_message(status));
COMMAND_REPLY_ERROR;
goto out;
}
tmp = silc_argument_get_arg_type(cmd->args, 1, NULL);
SILC_GET16_MSB(status, tmp);
if (status != SILC_STATUS_OK) {
- cmd->client->internal->ops->say(
- cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
- "%s", silc_client_command_status_message(status));
+ SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
+ "%s", silc_client_command_status_message(status));
COMMAND_REPLY_ERROR;
goto out;
}
tmp = silc_argument_get_arg_type(cmd->args, 1, NULL);
SILC_GET16_MSB(status, tmp);
if (status != SILC_STATUS_OK) {
- cmd->client->internal->ops->say(
- cmd->client, conn,
- SILC_CLIENT_MESSAGE_ERROR,
- "%s", silc_client_command_status_message(status));
+ SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
+ "%s", silc_client_command_status_message(status));
COMMAND_REPLY_ERROR;
goto out;
}
tmp = silc_argument_get_arg_type(cmd->args, 1, NULL);
SILC_GET16_MSB(status, tmp);
if (status != SILC_STATUS_OK) {
- cmd->client->internal->ops->say(
- cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
- "%s", silc_client_command_status_message(status));
+ SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
+ "%s", silc_client_command_status_message(status));
COMMAND_REPLY_ERROR;
goto out;
}
tmp = silc_argument_get_arg_type(cmd->args, 1, NULL);
SILC_GET16_MSB(status, tmp);
if (status != SILC_STATUS_OK) {
- cmd->client->internal->ops->say(
- cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
- "%s", silc_client_command_status_message(status));
+ SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
+ "%s", silc_client_command_status_message(status));
COMMAND_REPLY_ERROR;
goto out;
}
tmp = silc_argument_get_arg_type(cmd->args, 1, NULL);
SILC_GET16_MSB(status, tmp);
if (status != SILC_STATUS_OK) {
- cmd->client->internal->ops->say(
- cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
- "%s", silc_client_command_status_message(status));
+ SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
+ "%s", silc_client_command_status_message(status));
COMMAND_REPLY_ERROR;
goto out;
}
tmp = silc_argument_get_arg_type(cmd->args, 1, NULL);
SILC_GET16_MSB(status, tmp);
if (status != SILC_STATUS_OK) {
- cmd->client->internal->ops->say(
- cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
- "%s", silc_client_command_status_message(status));
+ SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
+ "%s", silc_client_command_status_message(status));
COMMAND_REPLY_ERROR;
goto out;
}
tmp = silc_argument_get_arg_type(cmd->args, 1, NULL);
SILC_GET16_MSB(status, tmp);
if (status != SILC_STATUS_OK) {
- cmd->client->internal->ops->say(
- cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
- "%s", silc_client_command_status_message(status));
+ SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
+ "%s", silc_client_command_status_message(status));
COMMAND_REPLY_ERROR;
goto out;
}
tmp = silc_argument_get_arg_type(cmd->args, 1, NULL);
SILC_GET16_MSB(status, tmp);
if (status != SILC_STATUS_OK) {
- cmd->client->internal->ops->say(
- cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
- "%s", silc_client_command_status_message(status));
+ SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
+ "%s", silc_client_command_status_message(status));
COMMAND_REPLY_ERROR;
goto out;
}
tmp = silc_argument_get_arg_type(cmd->args, 1, NULL);
SILC_GET16_MSB(status, tmp);
if (status != SILC_STATUS_OK) {
- cmd->client->internal->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
- "%s", silc_client_command_status_message(status));
+ SAY(cmd->client, conn, SILC_CLIENT_MESSAGE_ERROR,
+ "%s", silc_client_command_status_message(status));
COMMAND_REPLY_ERROR;
goto out;
}