From: Scott Worley Date: Fri, 3 Aug 2012 07:20:00 +0000 (-0700) Subject: rcaddmessagetohistory() accepts a message object X-Git-Url: http://git.scottworley.com/reliable-chat/commitdiff_plain/d7aa09ecdf7282d0f26d4b78f8c5e95c5330d40f?ds=inline rcaddmessagetohistory() accepts a message object Not just a string. --- diff --git a/webclient/rc.html b/webclient/rc.html index ff78fc0..8f69921 100644 --- a/webclient/rc.html +++ b/webclient/rc.html @@ -116,7 +116,7 @@ function rcaddmessagetohistory(message) { var d = document.createElement("div"); - d.appendChild(document.createTextNode(message)); + d.appendChild(document.createTextNode(message.Text)); var h = document.getElementById("history"); h.appendChild(d); window.scrollTo(0, document.body.scrollHeight); @@ -132,7 +132,7 @@ var seen_key = make_seen_key(messages[i]['ID'], messages[i]['Text']); if (!(seen_key in seen)) { seen[seen_key] = true; - rcaddmessagetohistory(messages[i]['Text']); + rcaddmessagetohistory(messages[i]); for (var i in servers) { rcchangeserverstatus(servers[i], "sad"); } @@ -208,7 +208,7 @@ message = "<" + rcnick() + "> " + input; } - var d = rcaddmessagetohistory(message); + var d = rcaddmessagetohistory({'Text': message}); rcsend(d, message); }