From 894ea6758f3f99c49807df99ef4bbd95f74273dc Mon Sep 17 00:00:00 2001 From: Brett Profitt Date: Mon, 13 Feb 2012 15:39:45 -0800 Subject: Fixes #11. Added notifications back. --- actions/photos/image/upload.php | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'actions/photos') diff --git a/actions/photos/image/upload.php b/actions/photos/image/upload.php index 3a1970367..29df59b63 100644 --- a/actions/photos/image/upload.php +++ b/actions/photos/image/upload.php @@ -7,7 +7,6 @@ */ elgg_load_library('tidypics:upload'); - $img_river_view = elgg_get_plugin_setting('img_river_view', 'tidypics'); $guid = (int) get_input('guid'); @@ -86,17 +85,35 @@ if (count($uploaded_images)) { $album->prependImageList($uploaded_images); + // "added images to album" river if ($img_river_view == "batch" && $album->new_album == false) { add_to_river('river/object/tidypics_batch/create', 'create', $batch->getObjectOwnerGUID(), $batch->getGUID()); } + // "created album" river if ($album->new_album) { $album->new_album = false; + $album->first_upload = true; + add_to_river('river/object/album/create', 'create', $album->getOwnerGUID(), $album->getGUID()); - // we throw the notification manually here so users are not told about the new album until there - // is at least a few photos in it - object_notifications('create', 'object', $album); + // "created album" notifications + // we throw the notification manually here so users are not told about the new album until + // there are at least a few photos in it + if ($album->shouldNotify()) { + object_notifications('create', 'object', $album); + $album->last_notified = time(); + } + } else { + // "added image to album" notifications + if ($album->first_upload) { + $album->first_upload = false; + } + + if ($album->shouldNotify()) { + object_notifications('create', 'object', $album); + $album->last_notified = time(); + } } } -- cgit v1.2.3