diff options
author | friendica <info@friendica.com> | 2013-02-05 16:54:09 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-02-05 16:54:09 -0800 |
commit | f3eb2eb9e7f5da80dae8518a70e05514a203d0f1 (patch) | |
tree | 90a1d8d6bdb8a4b2156a0502370373e2960673cf /mod/item.php | |
parent | 05ba851d52019decf84ea0325f4138f354355d37 (diff) | |
download | volse-hubzilla-f3eb2eb9e7f5da80dae8518a70e05514a203d0f1.tar.gz volse-hubzilla-f3eb2eb9e7f5da80dae8518a70e05514a203d0f1.tar.bz2 volse-hubzilla-f3eb2eb9e7f5da80dae8518a70e05514a203d0f1.zip |
convert wall_upload to use the photo api
Diffstat (limited to 'mod/item.php')
-rw-r--r-- | mod/item.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/mod/item.php b/mod/item.php index 080413be9..4bfb34e41 100644 --- a/mod/item.php +++ b/mod/item.php @@ -1006,6 +1006,27 @@ function fix_attached_photo_permissions($uid,$xchan_hash,$body, intval($uid), dbesc( t('Wall Photos')) ); + + // also update the linked item (which is probably invisible) + + $r = q("select id from item + WHERE allow_cid = '%s' AND allow_gid = '' AND deny_cid = '' AND deny_gid = '' + AND resource_id = '%s' and resource_type = 'photo' AND uid = %d LIMIT 1", + dbesc($srch), + dbesc($image_uri), + intval($uid) + ); + if($r) { + $r = q("UPDATE item SET allow_cid = '%s', allow_gid = '%s', deny_cid = '%s', deny_gid = '%s' + WHERE id = %d AND uid = %d limit 1", + dbesc($str_contact_allow), + dbesc($str_group_allow), + dbesc($str_contact_deny), + dbesc($str_group_deny), + intval($r[0]['id']), + intval($uid) + ); + } } } } |