]> git.scottworley.com Git - reliable-chat/commitdiff
rcaddmessagetohistory() accepts a message object
authorScott Worley <sworley@chkno.net>
Fri, 3 Aug 2012 07:20:00 +0000 (00:20 -0700)
committerScott Worley <sworley@chkno.net>
Fri, 3 Aug 2012 07:20:00 +0000 (00:20 -0700)
Not just a string.

webclient/rc.html

index ff78fc0bad03aea4f3f4d1c79738cc3bda5f3a49..8f69921f4241c678fc0d565045b6abb6699b882d 100644 (file)
 
        function rcaddmessagetohistory(message) {
                var d = document.createElement("div");
 
        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);
                var h = document.getElementById("history");
                h.appendChild(d);
                window.scrollTo(0, document.body.scrollHeight);
                        var seen_key = make_seen_key(messages[i]['ID'], messages[i]['Text']);
                        if (!(seen_key in seen)) {
                                seen[seen_key] = true;
                        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");
                                }
                                for (var i in servers) {
                                        rcchangeserverstatus(servers[i], "sad");
                                }
                        message = "<" + rcnick() + "> " + input;
                }
 
                        message = "<" + rcnick() + "> " + input;
                }
 
-               var d = rcaddmessagetohistory(message);
+               var d = rcaddmessagetohistory({'Text': message});
                rcsend(d, message);
        }
 
                rcsend(d, message);
        }