From 076238eb990ea8f38c55a4897de39cff34fafc74 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Sun, 27 Dec 2015 21:19:33 -0800 Subject: [PATCH] Include cosmo metadata in returned messages. --- static/hogfather.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/static/hogfather.js b/static/hogfather.js index ff23089..93a51f5 100644 --- a/static/hogfather.js +++ b/static/hogfather.js @@ -94,10 +94,13 @@ hogfather.PublicChat.prototype.getMessages = function() { if (message.message.type != 'message') { return; } + // Copy message so we can modify it. + message = JSON.parse(JSON.stringify(message)); // message == cosmopolite message // message.message = hogfather message // message.message.message == application message - ret.push(message.message.message); + message.message = message.message.message; + ret.push(message); }); return ret; };