From 59af476f7d0c29319931102f05b7b6da63c5ee54 Mon Sep 17 00:00:00 2001 From: Scott Ostler Date: Mon, 29 Nov 2010 02:23:50 -0500 Subject: fix pichat.js --- static/js/pichat.js | 14 ++++++-------- template/profile.st | 6 +++--- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/static/js/pichat.js b/static/js/pichat.js index 0a849eb..f378f3f 100644 --- a/static/js/pichat.js +++ b/static/js/pichat.js @@ -341,8 +341,7 @@ function buildMessageDiv(msg, opts) { var nick = escapeHtml(msg.nick); removeOldMessages(); - var builtContent = buildMsgContent(msg.content, opts.recips); - + var builtContent = buildMsgContent(msg.content, msg.recips); var msgId = ('msg_id' in msg) ? 'id="message-' + msg.msg_id + '"' : ''; var loadingClass = opts.isLoading ? ' loading' : ''; var containsImageClass = LastMsgContainsImage ? ' contains-image' : ''; @@ -511,9 +510,8 @@ function ifEnter(fn) { }; } -function addNewMessages(msgs, recips) { - var msgOpts = { recips: recips }; - var msgStr = $.map(msgs, function(msg) { buildMessageDiv(msg, msgOpts).join(''); }); +function addNewMessages(msgs) { + var msgStr = $.map(msgs, buildMessageDiv).join(''); $('#messageList').append(msgStr); } @@ -535,11 +533,11 @@ function flattenUserJson(users) { return s; } -function updateUI(msgs, users, favs, recips) { +function updateUI(msgs, users, favs) { if (window['growlize'] && msgs && msgs.length > 0) { $.map(msgs, buildGrowlDataAndPopDatShit) } else if (msgs && msgs.length > 0) { - addNewMessages(msgs, recips); + addNewMessages(msgs); } if (users !== null) { var flattened = flattenUserJson(users); @@ -577,7 +575,7 @@ function refresh() { var messages = $.grep( json.messages, function(m) { return !isDuplicateMessage(m) }); - updateUI(messages, json.users, json.favs, json.recips); + updateUI(messages, json.users, json.favs); if (!Away.HasFocus) Away.UnseenMsgCounter += messages.length; } catch(e) { diff --git a/template/profile.st b/template/profile.st index ce0a9e6..3aae2c2 100644 --- a/template/profile.st +++ b/template/profile.st @@ -101,11 +101,11 @@ $dm.content$ - }$ + $endif$ -- cgit v1.2.3-70-g09d2