From: Evan Prodromou Date: Wed, 3 Feb 2010 17:31:25 +0000 (-0500) Subject: clear cache for Profile::hasRepeated() at Notice::insert() time X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=dbeb388adefec94c3bb34e99305a004d845b719c;p=quix0rs-gnu-social.git clear cache for Profile::hasRepeated() at Notice::insert() time --- diff --git a/classes/Notice.php b/classes/Notice.php index 42878d94f1..f9f3863579 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -1468,4 +1468,25 @@ class Notice extends Memcached_DataObject $handler->handle($this); } } + + function insert() + { + $result = parent::insert(); + + if ($result) { + // Profile::hasRepeated() abuses pkeyGet(), so we + // have to clear manually + if (!empty($this->repeat_of)) { + $c = self::memcache(); + if (!empty($c)) { + $ck = self::multicacheKey('Notice', + array('profile_id' => $this->profile_id, + 'repeat_of' => $this->repeat_of)); + $c->delete($ck); + } + } + } + + return $result; + } }