Broadcast command: escape the message so it sends properly.

This commit is contained in:
Blair Bonnett 2012-08-14 12:08:31 +12:00
parent a12e79c7ce
commit 6f8bc0d270

View File

@ -450,7 +450,7 @@ static int command_whoip(struct command_base* cbase, struct hub_user* user, stru
static int command_broadcast(struct command_base* cbase, struct hub_user* user, struct hub_command* cmd) static int command_broadcast(struct command_base* cbase, struct hub_user* user, struct hub_command* cmd)
{ {
struct hub_command_arg_data* arg = hub_command_arg_next(cmd, type_string); struct hub_command_arg_data* arg = hub_command_arg_next(cmd, type_string);
char* message = arg->data.string; char* message = adc_msg_escape(arg->data.string);
size_t message_len = strlen(message); size_t message_len = strlen(message);
char pm_flag[7] = "PM"; char pm_flag[7] = "PM";
char from_sid[5]; char from_sid[5];
@ -485,6 +485,7 @@ static int command_broadcast(struct command_base* cbase, struct hub_user* user,
cbuf_append_format(buf, "*** %s: Delivered to " PRINTF_SIZE_T " user%s", cmd->prefix, recipients, (recipients != 1 ? "s" : "")); cbuf_append_format(buf, "*** %s: Delivered to " PRINTF_SIZE_T " user%s", cmd->prefix, recipients, (recipients != 1 ? "s" : ""));
send_message(cbase, user, buf); send_message(cbase, user, buf);
free(message);
return 0; return 0;
} }