summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorRobin Millette <millette@controlyourself.ca>2009-05-13 14:27:32 -0400
committerRobin Millette <millette@controlyourself.ca>2009-05-13 14:27:32 -0400
commit3b7ee5a5f9a2cd3066aff8a7a12d09878be3b06c (patch)
treed0f1521040251c6afe522f37f04aade4cd3fa89b /actions
parentd010d811ba812ccc8fbb1a49fcba7a30226ea779 (diff)
rewrote short url stuff to handle new file/url classes (redirections, oembed, mimetypes, etc.)
Diffstat (limited to 'actions')
-rw-r--r--actions/newnotice.php18
1 files changed, 3 insertions, 15 deletions
diff --git a/actions/newnotice.php b/actions/newnotice.php
index 8b03abc62..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)) {
@@ -203,25 +204,12 @@ class NewnoticeAction extends Action
* @return void
*/
function saveUrls($notice) {
- common_debug("Saving all URLs");
common_replace_urls_callback($notice->content, array($this, 'saveUrl'), $notice->id);
}
function saveUrl($data) {
list($url, $notice_id) = $data;
- common_debug("Saving $url for $notice_id");
- $file = File::staticGet('url', $url);
- if (empty($file)) {
- common_debug('unknown file/url');
- $file = new File;
- $file->url = $url;
- $file->insert();
- }
- common_debug('File: ' . print_r($file, true));
- $f2p = new File_to_post;
- $f2p->file_id = $file->id;
- $f2p->post_id = $notice_id;
- $f2p->insert();
+ $zzz = File::processNew($url, $notice_id);
}
/**