summaryrefslogtreecommitdiff
path: root/plugins/Meteor/meteorupdater.js
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-09-23 09:45:22 -0400
committerEvan Prodromou <evan@status.net>2009-09-23 09:45:22 -0400
commit8284b3cb82f4dec6e0f2bf74dea6e1a3bc7f4eac (patch)
tree09b8c466df2476f9219550464eb73f6ecaa54e1c /plugins/Meteor/meteorupdater.js
parent2cabfba767ba0d92d34a6ea4e4cf91c7325f3e95 (diff)
parentbef4a8b6ba9e19f2ec629031444279ca76f17bcf (diff)
Merge branch '0.8.x' into 0.9.x
Conflicts: actions/requesttoken.php classes/File.php install.php lib/noticeform.php
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();
+ }
+ }
}();