}
$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)) {
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;
+ }
+}