mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 23:35:12 +00:00
if xchan_censored is 2, don't refresh profile photo
This commit is contained in:
parent
c502b1153a
commit
3f529297da
2 changed files with 19 additions and 0 deletions
|
@ -19,6 +19,24 @@ class Xchan_photo implements DaemonInterface
|
|||
|
||||
// Some photo sources hang after connect and aren't caught by curl timeout
|
||||
|
||||
|
||||
$xchan = q("select * from xchan where xchan_hash = '%s'",
|
||||
dbesc($xchan)
|
||||
);
|
||||
|
||||
if ($xchan && (int)$xchan[0]['xchan_censored'] === 2) {
|
||||
$result = q("update xchan set xchan_photo_date = '%s', xchan_photo_l = '%s', xchan_photo_m = '%s', xchan_photo_s = '%s', xchan_photo_mimetype = '%s' where xchan_hash = '%s'",
|
||||
dbescdate(datetime_convert()),
|
||||
dbesc(z_root() . '/' . Channel::get_default_profile_photo()),
|
||||
dbesc(z_root() . '/' . Channel::get_default_profile_photo(80)),
|
||||
dbesc(z_root() . '/' . Channel::get_default_profile_photo(48)),
|
||||
dbesc('image/png'),
|
||||
dbesc($xchan)
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
set_time_limit(90);
|
||||
|
||||
$photos = import_remote_xchan_photo($url, $xchan);
|
||||
|
|
|
@ -2457,6 +2457,7 @@ class Activity
|
|||
// pages of Mastodon and Pleroma instance actors in the directory.
|
||||
// @TODO - (2021-08-27) remove this if they provide a non-person xchan_type
|
||||
// once extended xchan_type directory filtering is implemented.
|
||||
|
||||
$censored = ((strpos($profile, 'instance_actor') || strpos($profile, '/internal/fetch')) ? 1 : 0);
|
||||
|
||||
$r = q(
|
||||
|
|
Loading…
Reference in a new issue