[mw-devel] [Git][arthur/mw][master] js-duk: Only define to_name for IPC_SAYTOUSER

Andrew Price welshbyte at sucs.org
Sat Oct 6 11:59:09 BST 2018


Andrew Price pushed to branch master at Justin Mitchell / mw


Commits:
6862b2ac by Andrew Price at 2018-10-06T11:57:32+01:00
js-duk: Only define to_name for IPC_SAYTOUSER

Fixes #29

- - - - -


1 changed file:

- src/client/js-duk.c


Changes:

=====================================
src/client/js-duk.c
=====================================
--- a/src/client/js-duk.c
+++ b/src/client/js-duk.c
@@ -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");
-	js_push_username(msg->head.dst);
-	duk_put_prop_string(ctx, idx, "to_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"));



View it on GitLab: https://projects.sucs.org/arthur/mw/commit/6862b2aca74f3d25b7aa7f40858e672ff43c9133

-- 
View it on GitLab: https://projects.sucs.org/arthur/mw/commit/6862b2aca74f3d25b7aa7f40858e672ff43c9133
You're receiving this email because of your account on projects.sucs.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sucs.org/pipermail/mw-devel/attachments/20181006/723e20b6/attachment.html>


More information about the mw-devel mailing list