aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2019-04-04 16:46:40 +0200
committerMario <mario@mariovavti.com>2019-04-04 16:46:40 +0200
commit6adb489cb3e82d988f40b3ad79041bf8c6e48f32 (patch)
treebc8a0d036a1bed377ed2e2fcf937dc53f251eb13
parent410f37df1b46cde052f0317c957221df6e6a61dd (diff)
parent0c2db1cea593ea0f59d1cd3c918a5bccaf90c4c5 (diff)
downloadvolse-hubzilla-6adb489cb3e82d988f40b3ad79041bf8c6e48f32.tar.gz
volse-hubzilla-6adb489cb3e82d988f40b3ad79041bf8c6e48f32.tar.bz2
volse-hubzilla-6adb489cb3e82d988f40b3ad79041bf8c6e48f32.zip
Merge branch 'dev' into 'dev'
Sync cover photo removal with clones See merge request hubzilla/core!1581
-rw-r--r--Zotlabs/Module/Cover_photo.php20
1 files changed, 16 insertions, 4 deletions
diff --git a/Zotlabs/Module/Cover_photo.php b/Zotlabs/Module/Cover_photo.php
index df321ddb6..b67c00cdc 100644
--- a/Zotlabs/Module/Cover_photo.php
+++ b/Zotlabs/Module/Cover_photo.php
@@ -51,11 +51,24 @@ class Cover_photo extends \Zotlabs\Web\Controller {
// Remove cover photo
if(isset($_POST['remove'])) {
- q("update photo set photo_usage = %d where photo_usage = %d and uid = %d",
- intval(PHOTO_NORMAL),
+
+ $r = q("SELECT resource_id FROM photo WHERE photo_usage = %d AND uid = %d LIMIT 1",
intval(PHOTO_COVER),
intval(local_channel())
);
+
+ if($r) {
+ q("update photo set photo_usage = %d where photo_usage = %d and uid = %d",
+ intval(PHOTO_NORMAL),
+ intval(PHOTO_COVER),
+ intval(local_channel())
+ );
+
+ $sync = attach_export_data($channel,$r[0]['resource_id']);
+ if($sync)
+ build_sync_packet($channel['channel_id'],array('file' => array($sync)));
+ }
+
goaway(z_root() . '/cover_photo');
}
@@ -205,8 +218,7 @@ logger('gis: ' . print_r($gis,true));
);
return;
}
-
- $channel = \App::get_channel();
+
$this->send_cover_photo_activity($channel,$base_image,$profile);
$sync = attach_export_data($channel,$base_image['resource_id']);