summaryrefslogtreecommitdiff
path: root/plugins/GNUsocialPhotos/actions
diff options
context:
space:
mode:
authorSean Corbett <sean@gnu.org>2010-09-05 13:20:46 -0400
committerSean Corbett <sean@gnu.org>2010-09-05 13:20:46 -0400
commit2f06e2904251dbf7e8fe1211eda585c46971b1b5 (patch)
tree0831733be9a6c95cff6738d20aab16268f8265c2 /plugins/GNUsocialPhotos/actions
parent3b0e5ae94a62bb2713d96bf311b465b48385ac34 (diff)
parentfc131c2fb66997d42527e645ff475f7161165522 (diff)
Merge branch 'master' of git://140.232.178.237/home/ian/public_html/gnu-social
Diffstat (limited to 'plugins/GNUsocialPhotos/actions')
-rw-r--r--plugins/GNUsocialPhotos/actions/photoupload.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/plugins/GNUsocialPhotos/actions/photoupload.php b/plugins/GNUsocialPhotos/actions/photoupload.php
index b1b3ec705..a37c8d1ab 100644
--- a/plugins/GNUsocialPhotos/actions/photoupload.php
+++ b/plugins/GNUsocialPhotos/actions/photoupload.php
@@ -114,7 +114,6 @@ class PhotouploadAction extends Action
function uploadPhoto()
{
- common_log(LOG_INFO, 'Is this function even getting called?');
$cur = common_current_user();
if(empty($cur)) {
return;
@@ -138,8 +137,15 @@ class PhotouploadAction extends Action
$uri = 'http://' . common_config('site', 'server') . '/file/' . $filename;
$thumb_uri = 'http://' . common_config('site', 'server') . '/file/thumb.' . $filename;
$profile_id = $cur->id;
- //scorbett: the second arg below should be set to the album ID
- GNUsocialPhoto::saveNew($profile_id, 0, $thumb_uri, $uri, 'web');
+
+ // TODO: proper multiple album support
+ $album = GNUsocialPhotoAlbum::staticGet('profile_id', $profile_id);
+ if(!$album) {
+ $album = GNUsocialPhotoAlbum::newAlbum($profile_id, 'Default');
+ GNUsocialPhoto::saveNew($profile_id, $album->album_id, $thumb_uri, $uri, 'web');
+ } else {
+ GNUsocialPhoto::saveNew($profile_id, $album->album_id, $thumb_uri, $uri, 'web');
+ }
}
}