aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-11-01 02:15:40 -0700
committerzotlabs <mike@macgirvin.com>2017-11-01 02:15:40 -0700
commit7d9d1e0cdb21e47aec20b64148a0714323383914 (patch)
treeba894490a61148f152f6f3e36bfa8f63f14f890d
parent98b53801e062f1fe1b5ae16c6e30635b21ebef91 (diff)
downloadvolse-hubzilla-7d9d1e0cdb21e47aec20b64148a0714323383914.tar.gz
volse-hubzilla-7d9d1e0cdb21e47aec20b64148a0714323383914.tar.bz2
volse-hubzilla-7d9d1e0cdb21e47aec20b64148a0714323383914.zip
Maria's profile photo issue, please push to master.
-rw-r--r--Zotlabs/Module/Profile_photo.php10
-rw-r--r--include/zot.php4
2 files changed, 12 insertions, 2 deletions
diff --git a/Zotlabs/Module/Profile_photo.php b/Zotlabs/Module/Profile_photo.php
index 27e6bc445..411518c61 100644
--- a/Zotlabs/Module/Profile_photo.php
+++ b/Zotlabs/Module/Profile_photo.php
@@ -150,6 +150,14 @@ class Profile_photo extends \Zotlabs\Web\Controller {
// If setting for the default profile, unset the profile photo flag from any other photos I own
if($is_default_profile) {
+
+ $r = q("update profile set photo = '%s', thumb = '%s' where is_default = 1 and uid = %d",
+ dbesc(z_root() . '/photo/profile/l/' . local_channel()),
+ dbesc(z_root() . '/photo/profile/m/' . local_channel()),
+ intval(local_channel())
+ );
+
+
$r = q("UPDATE photo SET photo_usage = %d WHERE photo_usage = %d
AND resource_id != '%s' AND uid = %d",
intval(PHOTO_NORMAL),
@@ -159,8 +167,6 @@ class Profile_photo extends \Zotlabs\Web\Controller {
);
-
-
send_profile_photo_activity($channel,$base_image,$profile);
}
diff --git a/include/zot.php b/include/zot.php
index dad30dbb0..5270ed8b8 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -3649,6 +3649,7 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) {
$disallowed = array('id','aid','uid','guid');
foreach($arr['profile'] as $profile) {
+
$x = q("select * from profile where profile_guid = '%s' and uid = %d limit 1",
dbesc($profile['profile_guid']),
intval($channel['channel_id'])
@@ -3671,6 +3672,9 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) {
if(in_array($k,$disallowed))
continue;
+ if($profile['is_default'] && in_array($k,['photo','thumb']))
+ continue;
+
if($k === 'name')
$clean['fullname'] = $v;
elseif($k === 'with')