diff options
author | Evan Prodromou <evan@status.net> | 2009-09-23 09:29:02 -0400 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2009-09-23 09:29:02 -0400 |
commit | c01a5b8f2e37fe876507edfccc01126a117d9728 (patch) | |
tree | 93090403212c52e75a717730791917b1cc6f8fa0 /plugins/Meteor | |
parent | e80fad7ad9bd0bee6a9cf4cfd1615a9b07277364 (diff) | |
parent | acd5a53257f6d0677d1630e4f6cae80706cdbdba (diff) |
Merge branch '0.8.x' of git@gitorious.org:statusnet/mainline into 0.8.x
Diffstat (limited to 'plugins/Meteor')
-rw-r--r-- | plugins/Meteor/meteorupdater.js | 48 |
1 files changed, 32 insertions, 16 deletions
diff --git a/plugins/Meteor/meteorupdater.js b/plugins/Meteor/meteorupdater.js index 2e688336f..91d12cde9 100644 --- a/plugins/Meteor/meteorupdater.js +++ b/plugins/Meteor/meteorupdater.js @@ -1,21 +1,37 @@ -// update the local timeline from a Meteor server -// +// Update the local timeline from a Meteor server +// XXX: If @a is subscribed to @b, @a should get @b's notices in @a's Personal timeline. +// Do Replies timeline. var MeteorUpdater = function() { - return { - - init: function(server, port, timeline) - { - Meteor.callbacks["process"] = function(data) { - RealtimeUpdate.receive(JSON.parse(data)); - }; - - Meteor.host = server; - Meteor.port = port; - Meteor.joinChannel(timeline, 0); - Meteor.connect(); - } - } + return { + + init: function(server, port, timeline) + { + Meteor.callbacks["process"] = function(data) { + var d = JSON.parse(data); + + var user_url = $('address .url')[0].href+d['user']['screen_name']; + + var wlh = window.location.href; + + if (wlh.indexOf('?') > 0) { + wlh = wlh.slice(0, wlh.indexOf('?')) + } + + if (timeline == 'public' || + user_url+'/all' == wlh || + user_url == wlh) { + + RealtimeUpdate.receive(d); + } + }; + + Meteor.host = server; + Meteor.port = port; + Meteor.joinChannel(timeline, 0); + Meteor.connect(); + } + } }(); |