summaryrefslogtreecommitdiff
path: root/plugins/Realtime
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-07-15 15:30:33 -0400
committerEvan Prodromou <evan@controlyourself.ca>2009-07-15 15:30:33 -0400
commit8b1ac4ea2084ec8d4a1fb0439e1ad327ac573097 (patch)
tree4abbaf98b99372ed032aec0eb9535889926765f6 /plugins/Realtime
parent420980f0e0cd1023902b23d4082a0734d16c67a5 (diff)
let implementations build channel strings for realtime
Diffstat (limited to 'plugins/Realtime')
-rw-r--r--plugins/Realtime/RealtimePlugin.php24
1 files changed, 16 insertions, 8 deletions
diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php
index d01da5a50..507f0194d 100644
--- a/plugins/Realtime/RealtimePlugin.php
+++ b/plugins/Realtime/RealtimePlugin.php
@@ -61,16 +61,16 @@ class RealtimePlugin extends Plugin
function onEndShowScripts($action)
{
- $timeline = null;
+ $path = null;
switch ($action->trimmed('action')) {
case 'public':
- $timeline = 'timelines-public';
+ $path = array('public');
break;
case 'tag':
$tag = $action->trimmed('tag');
if (!empty($tag)) {
- $timeline = 'timelines-tag-'.$tag;
+ $path = array('tag', $tag);
} else {
return true;
}
@@ -79,6 +79,8 @@ class RealtimePlugin extends Plugin
return true;
}
+ $timeline = $this->_pathToChannel($path);
+
$scripts = $this->_getScripts();
foreach ($scripts as $script) {
@@ -106,30 +108,31 @@ class RealtimePlugin extends Plugin
function onEndNoticeSave($notice)
{
- $timelines = array();
+ $paths = array();
// XXX: Add other timelines; this is just for the public one
if ($notice->is_local ||
($notice->is_local == 0 && !common_config('public', 'localonly'))) {
- $timelines[] = 'timelines-public';
+ $paths[] = array('public');
}
$tags = $this->getNoticeTags($notice);
if (!empty($tags)) {
foreach ($tags as $tag) {
- $timelines[] = 'timelines-tag-' . $tag;
+ $paths[] = array('tag', $tag);
}
}
- if (count($timelines) > 0) {
+ if (count($paths) > 0) {
$json = $this->noticeAsJson($notice);
$this->_connect();
- foreach ($timelines as $timeline) {
+ foreach ($paths as $path) {
+ $timeline = $this->_pathToChannel($path);
$this->_publish($timeline, $json);
}
@@ -218,4 +221,9 @@ class RealtimePlugin extends Plugin
function _disconnect()
{
}
+
+ function _pathToChannel($path)
+ {
+ return '';
+ }
}