summaryrefslogtreecommitdiff
path: root/classes/Notice.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-12-06 16:38:02 -0500
committerEvan Prodromou <evan@status.net>2010-12-06 16:38:02 -0500
commit8564fc51c53de7a0670720eec437000a6b972688 (patch)
tree8cc61941093d094a6175b73d87de5845e4931afe /classes/Notice.php
parentda8b268e06f4a6217c2bbb4918888001f8e7e4cd (diff)
cache generated activity info
Diffstat (limited to 'classes/Notice.php')
-rw-r--r--classes/Notice.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index de5104fdb..46e1dca35 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -1236,10 +1236,16 @@ class Notice extends Memcached_DataObject
function asActivity($cur = null, $source = false)
{
+ $act = self::cacheGet('notice:as-activity:'.$this->id);
+
+ if (!empty($act)) {
+ return $act;
+ }
+
$act = new Activity();
if (Event::handle('StartNoticeAsActivity', array($this, &$act))) {
-
+
$profile = $this->getProfile();
$act->actor = ActivityObject::fromProfile($profile);
@@ -1400,6 +1406,8 @@ class Notice extends Memcached_DataObject
Event::handle('EndNoticeAsActivity', array($this, &$act));
}
+ self::cacheSet('notice:as-activity:'.$this->id, $act);
+
return $act;
}