Commit 6862b2ac authored by Andrew Price's avatar Andrew Price
Browse files

js-duk: Only define to_name for IPC_SAYTOUSER

Fixes #29
parent 8b517048
Loading
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -177,9 +177,10 @@ static int js_push_ipcmsg_event(ipc_message_t *msg)
	duk_put_prop_string(ctx, idx, "ipc_type");
	js_push_username(msg->head.src);
	duk_put_prop_string(ctx, idx, "from_name");
	if (msg->head.type == IPC_SAYTOUSER) {
		js_push_username(msg->head.dst);
		duk_put_prop_string(ctx, idx, "to_name");

	}
	duk_push_string(ctx, json_getstring(json, "type"));
	duk_put_prop_string(ctx, idx, "type");
	duk_push_string(ctx, json_getstring(json, "text"));