summaryrefslogtreecommitdiff
path: root/plugins/Meteor/meteorupdater.js
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Meteor/meteorupdater.js')
-rw-r--r--plugins/Meteor/meteorupdater.js48
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();
+ }
+ }
}();