diff options
author | Zach Copley <zach@controlyourself.ca> | 2009-05-15 23:17:57 +0000 |
---|---|---|
committer | Zach Copley <zach@controlyourself.ca> | 2009-05-15 23:17:57 +0000 |
commit | 811cef10083f8b7824b2fd8140f940bf13b54c8d (patch) | |
tree | 3d403c3c7e08a79a3a87c5bafacfb3f08fcd4211 /actions/newnotice.php | |
parent | 3f44f94c3c3f0c3d46f5025854431f0d2825bb6c (diff) | |
parent | 6c4e26fe61a3c1cada4775a42a929eb884150b2d (diff) |
Merge branch '0.8.x' into fbconnect
Diffstat (limited to 'actions/newnotice.php')
-rw-r--r-- | actions/newnotice.php | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/actions/newnotice.php b/actions/newnotice.php index cbd04c58b..ae0ff9636 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -158,7 +158,8 @@ class NewnoticeAction extends Action $replyto = 'false'; } - $notice = Notice::saveNew($user->id, $content, 'web', 1, +// $notice = Notice::saveNew($user->id, $content_shortened, 'web', 1, + $notice = Notice::saveNew($user->id, $content_shortened, 'web', 1, ($replyto == 'false') ? null : $replyto); if (is_string($notice)) { @@ -166,6 +167,8 @@ class NewnoticeAction extends Action return; } + $this->saveUrls($notice); + common_broadcast_notice($notice); if ($this->boolean('ajax')) { @@ -191,6 +194,24 @@ class NewnoticeAction extends Action } } + /** 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($notice) { + common_replace_urls_callback($notice->content, array($this, 'saveUrl'), $notice->id); + } + + function saveUrl($data) { + list($url, $notice_id) = $data; + $zzz = File::processNew($url, $notice_id); + } + /** * Show an Ajax-y error message * |