convert wall_upload to use the photo api

This commit is contained in:
friendica
2013-02-05 16:54:09 -08:00
parent 05ba851d52
commit f3eb2eb9e7
4 changed files with 41 additions and 138 deletions

View File

@@ -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)
);
}
}
}
}