aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2019-04-03 12:05:22 +0200
committerMax Kostikov <max@kostikov.co>2019-04-03 12:05:22 +0200
commite33604887bfc2671d933f425215d8c264dcbcab9 (patch)
treec796b0cb1fd67ff9cf96913f973eeed20c4e789b /Zotlabs
parent410f37df1b46cde052f0317c957221df6e6a61dd (diff)
downloadvolse-hubzilla-e33604887bfc2671d933f425215d8c264dcbcab9.tar.gz
volse-hubzilla-e33604887bfc2671d933f425215d8c264dcbcab9.tar.bz2
volse-hubzilla-e33604887bfc2671d933f425215d8c264dcbcab9.zip
Sync cover photo removal with clones
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Cover_photo.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/Zotlabs/Module/Cover_photo.php b/Zotlabs/Module/Cover_photo.php
index df321ddb6..89bfcc281 100644
--- a/Zotlabs/Module/Cover_photo.php
+++ b/Zotlabs/Module/Cover_photo.php
@@ -51,11 +51,23 @@ class Cover_photo extends \Zotlabs\Web\Controller {
// Remove cover photo
if(isset($_POST['remove'])) {
+
+ $r = q("SELECT resource_id FROM photo WHERE photo_usage = %d AND uid = %d LIMIT 1",
+ intval(PHOTO_COVER),
+ intval(local_channel())
+ );
+
q("update photo set photo_usage = %d where photo_usage = %d and uid = %d",
intval(PHOTO_NORMAL),
intval(PHOTO_COVER),
intval(local_channel())
);
+
+ if($r) {
+ $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 +217,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']);