X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FConversation.php;h=e029c20ba0d095145cff147b35aaec6f49d5dd5b;hb=cb183359e23ae7a5cfb483fa06c6c4b7a8b05fff;hp=ea8bd87b5636907893101255dccc67dac81942d4;hpb=6781f95c733ed4d678fc4c09926efe195e590359;p=quix0rs-gnu-social.git diff --git a/classes/Conversation.php b/classes/Conversation.php index ea8bd87b56..e029c20ba0 100755 --- a/classes/Conversation.php +++ b/classes/Conversation.php @@ -63,7 +63,8 @@ class Conversation extends Memcached_DataObject } $orig = clone($conv); - $orig->uri = common_local_url('conversation', array('id' => $id)); + $orig->uri = common_local_url('conversation', array('id' => $id), + null, null, false); $result = $orig->update($conv); if (empty($result)) { @@ -74,5 +75,22 @@ class Conversation extends Memcached_DataObject return $conv; } -} + static function noticeCount($id) + { + $keypart = sprintf('conversation:notice_count:%d', $id); + + $cnt = self::cacheGet($keypart); + + if ($cnt !== false) { + return $cnt; + } + $notice = new Notice(); + $notice->conversation = $id; + $cnt = $notice->count(); + + self::cacheSet($keypart, $cnt); + + return $cnt; + } +}