Stream of notices linking to an URL

This commit is contained in:
Evan Prodromou
2010-12-28 11:58:55 -08:00
parent c8bbde69df
commit bf4c5cb41a
2 changed files with 80 additions and 0 deletions

View File

@@ -52,6 +52,12 @@ class File_to_post extends Memcached_DataObject
$f2p->file_id = $file_id;
$f2p->post_id = $notice_id;
$f2p->insert();
$f = File::staticGet($file_id);
if (!empty($f)) {
$f->blowNoticeCache();
}
}
if (empty($seen[$notice_id])) {
@@ -66,4 +72,13 @@ class File_to_post extends Memcached_DataObject
{
return Memcached_DataObject::pkeyGet('File_to_post', $kv);
}
function delete()
{
$f = File::staticGet('id', $this->file_id);
if (!empty($f)) {
$f->blowNoticeCache();
}
return parent::delete();
}
}