diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-06-17 08:18:33 -0700 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-06-17 08:18:33 -0700 |
commit | 8384e7c7f63d209cf0cbf9574586de84f88959d0 (patch) | |
tree | eae427b63473b0f3938a56da9dfbdbce15592ebc /classes/Notice.php | |
parent | 312fd855324b680c45b71c683b9589f24e1b31a9 (diff) | |
parent | 85a4e32f30fcc1b081cde7c8e0267b4fd0c83e16 (diff) |
Merge branch '0.8.x' of git@gitorious.org:+laconica-developers/laconica/dev into 0.8.x
Diffstat (limited to 'classes/Notice.php')
-rw-r--r-- | classes/Notice.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/classes/Notice.php b/classes/Notice.php index 333832d0b..6c5558d88 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -222,6 +222,7 @@ class Notice extends Memcached_DataObject $notice->addToInboxes(); $notice->saveGroups(); + $notice->saveUrls(); $notice->query('COMMIT'); @@ -236,6 +237,24 @@ class Notice extends Memcached_DataObject return $notice; } + /** save all urls in the notice to the db + * + * follow redirects and save all available file information + * (mimetype, date, size, oembed, etc.) + * + * @param class $notice Notice to pull URLs from + * + * @return void + */ + function saveUrls() { + common_replace_urls_callback($this->content, array($this, 'saveUrl'), $this->id); + } + + function saveUrl($data) { + list($url, $notice_id) = $data; + File::processNew($url, $notice_id); + } + static function checkDupes($profile_id, $content) { $profile = Profile::staticGet($profile_id); if (!$profile) { |