diff options
author | Cash Costello <cash.costello@gmail.com> | 2012-07-13 22:23:52 -0400 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2012-07-13 22:23:52 -0400 |
commit | 54bc5844dfe6cb684c7aecaf1be5ee8071d98fe0 (patch) | |
tree | 90f4166d6cd605eb4d7e95d63682732a1c5476a5 /actions/photos | |
parent | 695651451b262c526d6aaf9d0988ce557ff50e95 (diff) | |
parent | 894ea6758f3f99c49807df99ef4bbd95f74273dc (diff) | |
download | elgg-54bc5844dfe6cb684c7aecaf1be5ee8071d98fe0.tar.gz elgg-54bc5844dfe6cb684c7aecaf1be5ee8071d98fe0.tar.bz2 |
Merged notifications update from Brett's fork
Diffstat (limited to 'actions/photos')
-rw-r--r-- | actions/photos/image/upload.php | 25 |
1 files changed, 21 insertions, 4 deletions
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(); + } } } |