From 49e91ec7d068fa7b98576207696d2192418baf5b Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Sun, 20 Sep 2009 15:14:46 +0000 Subject: Added realtime streams for all and showstream timelines --- plugins/Meteor/meteorupdater.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'plugins/Meteor') diff --git a/plugins/Meteor/meteorupdater.js b/plugins/Meteor/meteorupdater.js index 2e688336f..e8bca3eb4 100644 --- a/plugins/Meteor/meteorupdater.js +++ b/plugins/Meteor/meteorupdater.js @@ -7,8 +7,17 @@ var MeteorUpdater = function() init: function(server, port, timeline) { + var screen_name; + Meteor.callbacks["process"] = function(data) { - RealtimeUpdate.receive(JSON.parse(data)); + var d = JSON.parse(data); + screen_name = d['user']['screen_name']; + + if (timeline == 'public' || + $('address .url')[0].href+screen_name+'/all' == window.location.href || + $('address .url')[0].href+screen_name == window.location.href) { + RealtimeUpdate.receive(d); + } }; Meteor.host = server; -- cgit v1.2.3-54-g00ecf From 182257cbbf1557c2671b1995c9126c45b0bd8e79 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Sun, 20 Sep 2009 15:20:10 +0000 Subject: Fixed indenting --- plugins/Meteor/meteorupdater.js | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'plugins/Meteor') diff --git a/plugins/Meteor/meteorupdater.js b/plugins/Meteor/meteorupdater.js index e8bca3eb4..939aed00a 100644 --- a/plugins/Meteor/meteorupdater.js +++ b/plugins/Meteor/meteorupdater.js @@ -3,28 +3,28 @@ var MeteorUpdater = function() { - return { + return { - init: function(server, port, timeline) - { - var screen_name; + init: function(server, port, timeline) + { + var screen_name; - Meteor.callbacks["process"] = function(data) { - var d = JSON.parse(data); - screen_name = d['user']['screen_name']; + Meteor.callbacks["process"] = function(data) { + var d = JSON.parse(data); + screen_name = d['user']['screen_name']; - if (timeline == 'public' || - $('address .url')[0].href+screen_name+'/all' == window.location.href || - $('address .url')[0].href+screen_name == window.location.href) { - RealtimeUpdate.receive(d); - } - }; + if (timeline == 'public' || + $('address .url')[0].href+screen_name+'/all' == window.location.href || + $('address .url')[0].href+screen_name == window.location.href) { + RealtimeUpdate.receive(d); + } + }; - Meteor.host = server; - Meteor.port = port; - Meteor.joinChannel(timeline, 0); - Meteor.connect(); - } - } + Meteor.host = server; + Meteor.port = port; + Meteor.joinChannel(timeline, 0); + Meteor.connect(); + } + } }(); -- cgit v1.2.3-54-g00ecf From 8f84bc88d7855ac86b87bf4e8813e18c565d1a52 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 21 Sep 2009 11:32:36 +0000 Subject: Updated todo comment for pushing notices to Personal and Replies timelines --- plugins/Meteor/meteorupdater.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins/Meteor') diff --git a/plugins/Meteor/meteorupdater.js b/plugins/Meteor/meteorupdater.js index 939aed00a..82594d91c 100644 --- a/plugins/Meteor/meteorupdater.js +++ b/plugins/Meteor/meteorupdater.js @@ -1,5 +1,6 @@ -// 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() { -- cgit v1.2.3-54-g00ecf From c9bc3900909a85b9b4be31c4dac7f809127a8bf0 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 21 Sep 2009 11:35:56 +0000 Subject: Made it slighly more compact with less jQuery selection --- plugins/Meteor/meteorupdater.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'plugins/Meteor') diff --git a/plugins/Meteor/meteorupdater.js b/plugins/Meteor/meteorupdater.js index 82594d91c..a7c87330c 100644 --- a/plugins/Meteor/meteorupdater.js +++ b/plugins/Meteor/meteorupdater.js @@ -8,15 +8,15 @@ var MeteorUpdater = function() init: function(server, port, timeline) { - var screen_name; - Meteor.callbacks["process"] = function(data) { var d = JSON.parse(data); - screen_name = d['user']['screen_name']; + + $user_url = $('address .url')[0].href+d['user']['screen_name']; if (timeline == 'public' || - $('address .url')[0].href+screen_name+'/all' == window.location.href || - $('address .url')[0].href+screen_name == window.location.href) { + $user_url+'/all' == window.location.href || + $user_url == window.location.href) { + RealtimeUpdate.receive(d); } }; -- cgit v1.2.3-54-g00ecf From 13de845e95da9ea579516c4480789819c9a26edd Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 21 Sep 2009 14:30:12 +0000 Subject: Added a check for any URL param. If found, strips them out before going ahead with realtime timeline update. --- plugins/Meteor/meteorupdater.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'plugins/Meteor') diff --git a/plugins/Meteor/meteorupdater.js b/plugins/Meteor/meteorupdater.js index a7c87330c..91d12cde9 100644 --- a/plugins/Meteor/meteorupdater.js +++ b/plugins/Meteor/meteorupdater.js @@ -11,11 +11,17 @@ var MeteorUpdater = function() Meteor.callbacks["process"] = function(data) { var d = JSON.parse(data); - $user_url = $('address .url')[0].href+d['user']['screen_name']; + 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' == window.location.href || - $user_url == window.location.href) { + user_url+'/all' == wlh || + user_url == wlh) { RealtimeUpdate.receive(d); } -- cgit v1.2.3-54-g00ecf From e6cbe3a26938ca8d88d44bacc6c40ba09f5f1fd1 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 23 Sep 2009 11:07:22 -0400 Subject: Revert "Added a check for any URL param. If found, strips them out before" This reverts commit 13de845e95da9ea579516c4480789819c9a26edd. --- plugins/Meteor/meteorupdater.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'plugins/Meteor') diff --git a/plugins/Meteor/meteorupdater.js b/plugins/Meteor/meteorupdater.js index 91d12cde9..a7c87330c 100644 --- a/plugins/Meteor/meteorupdater.js +++ b/plugins/Meteor/meteorupdater.js @@ -11,17 +11,11 @@ var MeteorUpdater = function() 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('?')) - } + $user_url = $('address .url')[0].href+d['user']['screen_name']; if (timeline == 'public' || - user_url+'/all' == wlh || - user_url == wlh) { + $user_url+'/all' == window.location.href || + $user_url == window.location.href) { RealtimeUpdate.receive(d); } -- cgit v1.2.3-54-g00ecf From 87ff03890e6512bf4cf336c5583382e22bb75414 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 23 Sep 2009 11:07:56 -0400 Subject: Revert "Made it slighly more compact with less jQuery selection" This reverts commit c9bc3900909a85b9b4be31c4dac7f809127a8bf0. --- plugins/Meteor/meteorupdater.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'plugins/Meteor') diff --git a/plugins/Meteor/meteorupdater.js b/plugins/Meteor/meteorupdater.js index a7c87330c..82594d91c 100644 --- a/plugins/Meteor/meteorupdater.js +++ b/plugins/Meteor/meteorupdater.js @@ -8,15 +8,15 @@ var MeteorUpdater = function() init: function(server, port, timeline) { + var screen_name; + Meteor.callbacks["process"] = function(data) { var d = JSON.parse(data); - - $user_url = $('address .url')[0].href+d['user']['screen_name']; + screen_name = d['user']['screen_name']; if (timeline == 'public' || - $user_url+'/all' == window.location.href || - $user_url == window.location.href) { - + $('address .url')[0].href+screen_name+'/all' == window.location.href || + $('address .url')[0].href+screen_name == window.location.href) { RealtimeUpdate.receive(d); } }; -- cgit v1.2.3-54-g00ecf From 35eb33fe2bd0d41fb4c03000c557c36125b2c809 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 23 Sep 2009 11:08:12 -0400 Subject: Revert "Fixed indenting" This reverts commit 182257cbbf1557c2671b1995c9126c45b0bd8e79. --- plugins/Meteor/meteorupdater.js | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'plugins/Meteor') diff --git a/plugins/Meteor/meteorupdater.js b/plugins/Meteor/meteorupdater.js index 82594d91c..de01d430a 100644 --- a/plugins/Meteor/meteorupdater.js +++ b/plugins/Meteor/meteorupdater.js @@ -4,28 +4,28 @@ var MeteorUpdater = function() { - return { + return { - init: function(server, port, timeline) - { - var screen_name; + init: function(server, port, timeline) + { + var screen_name; - Meteor.callbacks["process"] = function(data) { - var d = JSON.parse(data); - screen_name = d['user']['screen_name']; + Meteor.callbacks["process"] = function(data) { + var d = JSON.parse(data); + screen_name = d['user']['screen_name']; - if (timeline == 'public' || - $('address .url')[0].href+screen_name+'/all' == window.location.href || - $('address .url')[0].href+screen_name == window.location.href) { - RealtimeUpdate.receive(d); - } - }; + if (timeline == 'public' || + $('address .url')[0].href+screen_name+'/all' == window.location.href || + $('address .url')[0].href+screen_name == window.location.href) { + RealtimeUpdate.receive(d); + } + }; - Meteor.host = server; - Meteor.port = port; - Meteor.joinChannel(timeline, 0); - Meteor.connect(); - } - } + Meteor.host = server; + Meteor.port = port; + Meteor.joinChannel(timeline, 0); + Meteor.connect(); + } + } }(); -- cgit v1.2.3-54-g00ecf From 6cb2f89983f89fb7f4559fe607ca2af2c6729d27 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 23 Sep 2009 11:08:35 -0400 Subject: Revert "Added realtime streams for all and showstream timelines" This reverts commit 49e91ec7d068fa7b98576207696d2192418baf5b. --- plugins/Meteor/meteorupdater.js | 11 +---------- plugins/Realtime/RealtimePlugin.php | 34 +++++++++++++++------------------- 2 files changed, 16 insertions(+), 29 deletions(-) (limited to 'plugins/Meteor') diff --git a/plugins/Meteor/meteorupdater.js b/plugins/Meteor/meteorupdater.js index de01d430a..9ce68775b 100644 --- a/plugins/Meteor/meteorupdater.js +++ b/plugins/Meteor/meteorupdater.js @@ -8,17 +8,8 @@ var MeteorUpdater = function() init: function(server, port, timeline) { - var screen_name; - Meteor.callbacks["process"] = function(data) { - var d = JSON.parse(data); - screen_name = d['user']['screen_name']; - - if (timeline == 'public' || - $('address .url')[0].href+screen_name+'/all' == window.location.href || - $('address .url')[0].href+screen_name == window.location.href) { - RealtimeUpdate.receive(d); - } + RealtimeUpdate.receive(JSON.parse(data)); }; Meteor.host = server; diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php index 611b1d86c..454882261 100644 --- a/plugins/Realtime/RealtimePlugin.php +++ b/plugins/Realtime/RealtimePlugin.php @@ -63,22 +63,20 @@ class RealtimePlugin extends Plugin { $path = null; - $a = $action->trimmed('action'); - - switch ($a) { - case 'public': case 'all': case 'replies': case 'showstream': - $path = array($a); - break; - case 'tag': - $tag = $action->trimmed('tag'); - if (!empty($tag)) { - $path = array('tag', $tag); - } else { - return true; - } - break; - default: + switch ($action->trimmed('action')) { + case 'public': + $path = array('public'); + break; + case 'tag': + $tag = $action->trimmed('tag'); + if (!empty($tag)) { + $path = array('tag', $tag); + } else { return true; + } + break; + default: + return true; } $timeline = $this->_pathToChannel($path); @@ -116,13 +114,11 @@ class RealtimePlugin extends Plugin { $paths = array(); - // TODO: Replies timeline + // XXX: Add other timelines; this is just for the public one if ($notice->is_local || ($notice->is_local == 0 && !common_config('public', 'localonly'))) { - foreach (array('public', 'all', 'replies', 'showstream') as $a) { - $paths[] = array($a); - } + $paths[] = array('public'); } $tags = $this->getNoticeTags($notice); -- cgit v1.2.3-54-g00ecf