summaryrefslogtreecommitdiff
path: root/static/js/pichat.js
diff options
context:
space:
mode:
authorScott Ostler <sbsotler@gmail.com>2010-11-29 02:23:50 -0500
committerScott Ostler <sbsotler@gmail.com>2010-11-29 02:23:50 -0500
commit59af476f7d0c29319931102f05b7b6da63c5ee54 (patch)
tree80969c53907e46eda9592d038950ef7eae9a43d8 /static/js/pichat.js
parent25f6bb92ef2920d4d97fcf443573f0b09d3bb14f (diff)
fix pichat.js
Diffstat (limited to 'static/js/pichat.js')
-rw-r--r--static/js/pichat.js14
1 files changed, 6 insertions, 8 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) {