aboutsummaryrefslogtreecommitdiffstats
path: root/include/attach.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2015-10-24 21:44:25 +0200
committerMario Vavti <mario@mariovavti.com>2015-10-24 21:44:25 +0200
commitab8b4d5c3669543a6166390d433569656692f9b8 (patch)
tree3c6f2606d3830ec7692c430fa270c56eb24f9675 /include/attach.php
parent3432771150c03c72d468e5840177b769812a9758 (diff)
downloadvolse-hubzilla-ab8b4d5c3669543a6166390d433569656692f9b8.tar.gz
volse-hubzilla-ab8b4d5c3669543a6166390d433569656692f9b8.tar.bz2
volse-hubzilla-ab8b4d5c3669543a6166390d433569656692f9b8.zip
another try to avoid dubble photo deletion. allow to set a photo caption and simple status body (if create status post is enabled) on upload
Diffstat (limited to 'include/attach.php')
-rw-r--r--include/attach.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/include/attach.php b/include/attach.php
index f95feed2d..f5d2c69b6 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -815,6 +815,12 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
if($arr['item'])
$args['item'] = $arr['item'];
+ if($arr['body'])
+ $args['body'] = $arr['body'];
+
+ if($arr['description'])
+ $args['description'] = $arr['description'];
+
$p = photo_upload($channel,$observer,$args);
if($p['success']) {
$ret['body'] = $p['body'];
@@ -1282,12 +1288,11 @@ function attach_delete($channel_id, $resource, $is_photo = 0) {
);
if($x) {
drop_item($x[0]['id'],false,(($x[0]['item_hidden']) ? DROPITEM_NORMAL : DROPITEM_PHASE1),true);
-
- q("DELETE FROM photo WHERE uid = %d AND resource_id = '%s'",
- intval($channel_id),
- dbesc($resource)
- );
}
+ q("DELETE FROM photo WHERE uid = %d AND resource_id = '%s'",
+ intval($channel_id),
+ dbesc($resource)
+ );
}
// update the parent folder's lastmodified timestamp