summaryrefslogtreecommitdiff
path: root/plugins/Comet/updatetimeline.js
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Comet/updatetimeline.js')
-rw-r--r--plugins/Comet/updatetimeline.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/plugins/Comet/updatetimeline.js b/plugins/Comet/updatetimeline.js
index c6eefb447..de750baba 100644
--- a/plugins/Comet/updatetimeline.js
+++ b/plugins/Comet/updatetimeline.js
@@ -23,6 +23,14 @@ var updater = function()
function receive(message)
{
+ id = message.data.id;
+
+ // Don't add it if it already exists
+
+ if ($("#notice-"+id).length > 0) {
+ return;
+ }
+
var noticeItem = makeNoticeItem(message.data);
$("#notices_primary .notices").prepend(noticeItem, true);
$("#notices_primary .notice:first").css({display:"none"});
@@ -34,6 +42,8 @@ var updater = function()
function makeNoticeItem(data)
{
user = data['user'];
+ html = data['html'].replace(/&amp;/g,'&').replace(/&lt;/g,'<').replace(/&gt;/g,'>');
+
ni = "<li class=\"hentry notice\" id=\"notice-"+data['id']+"\">"+
"<div class=\"entry-title\">"+
"<span class=\"vcard author\">"+
@@ -42,7 +52,7 @@ var updater = function()
"<span class=\"nickname fn\">"+user['screen_name']+"</span>"+
"</a>"+
"</span>"+
- "<p class=\"entry-content\">"+data['text']+"</p>"+
+ "<p class=\"entry-content\">"+html+"</p>"+
"</div>"+
"<div class=\"entry-content\">"+
"<dl class=\"timestamp\">"+