summaryrefslogtreecommitdiff
path: root/plugins/Comet/CometPlugin.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-04-27 15:28:36 -0400
committerEvan Prodromou <evan@controlyourself.ca>2009-04-27 15:28:36 -0400
commit8cf8298dc02b1373fed53eb95982a33b969b42ee (patch)
treefdba11df68fc6d6bbe116d0463c2ef9e374015fd /plugins/Comet/CometPlugin.php
parent7405d9dfa684975309150537069a1268a67ed6be (diff)
parente97223b2ba3f9f1818ba12b707c53c0ebdcab144 (diff)
Merge branch 'cometplugin' into 0.7.x
Diffstat (limited to 'plugins/Comet/CometPlugin.php')
-rw-r--r--plugins/Comet/CometPlugin.php37
1 files changed, 37 insertions, 0 deletions
diff --git a/plugins/Comet/CometPlugin.php b/plugins/Comet/CometPlugin.php
index a7a4f4b23..2e0bb40a4 100644
--- a/plugins/Comet/CometPlugin.php
+++ b/plugins/Comet/CometPlugin.php
@@ -62,6 +62,14 @@ class CometPlugin extends Plugin
case 'public':
$timeline = '/timelines/public';
break;
+ case 'tag':
+ $tag = $action->trimmed('tag');
+ if (!empty($tag)) {
+ $timeline = '/timelines/tag/'.$tag;
+ } else {
+ return true;
+ }
+ break;
default:
return true;
}
@@ -94,6 +102,14 @@ class CometPlugin extends Plugin
$timelines[] = '/timelines/public';
}
+ $tags = $this->getNoticeTags($notice);
+
+ if (!empty($tags)) {
+ foreach ($tags as $tag) {
+ $timelines[] = '/timelines/tag/' . $tag;
+ }
+ }
+
if (count($timelines) > 0) {
// Require this, since we need it
require_once(INSTALLDIR.'/plugins/Comet/bayeux.class.inc.php');
@@ -127,6 +143,7 @@ class CometPlugin extends Plugin
$arr = $act->twitter_status_array($notice, true);
$arr['url'] = $notice->bestUrl();
+ $arr['html'] = htmlspecialchars($notice->rendered);
$profile = $notice->getProfile();
$arr['user']['profile_url'] = $profile->profileurl;
@@ -134,6 +151,26 @@ class CometPlugin extends Plugin
return $arr;
}
+ function getNoticeTags($notice)
+ {
+ $tags = null;
+
+ $nt = new Notice_tag();
+ $nt->notice_id = $notice->id;
+
+ if ($nt->find()) {
+ $tags = array();
+ while ($nt->fetch()) {
+ $tags[] = $nt->tag;
+ }
+ }
+
+ $nt->free();
+ $nt = null;
+
+ return $tags;
+ }
+
// Push this up to Plugin
function log($level, $msg)