Use randon pictures for networks that don't support banners
This commit is contained in:
parent
8147073c47
commit
cfd63f5682
1 changed files with 10 additions and 0 deletions
|
@ -2229,6 +2229,7 @@ class Contact
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($ret['header']) && !empty($gsid)) {
|
if (empty($ret['header']) && !empty($gsid)) {
|
||||||
|
// Use default banners for certain platforms
|
||||||
$gserver = DBA::selectFirst('gserver', ['platform'], ['id' => $gsid]);
|
$gserver = DBA::selectFirst('gserver', ['platform'], ['id' => $gsid]);
|
||||||
switch (strtolower($gserver['platform'] ?? '')) {
|
switch (strtolower($gserver['platform'] ?? '')) {
|
||||||
case 'friendica':
|
case 'friendica':
|
||||||
|
@ -2253,6 +2254,15 @@ class Contact
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($ret['header']) && !in_array($ret['network'], [Protocol::ACTIVITYPUB, Protocol::TWITTER])) {
|
||||||
|
/**
|
||||||
|
* Use random pictures for networks that don't provide banners.
|
||||||
|
* The service provides random pictures from Unsplash.
|
||||||
|
* @license https://unsplash.com/license
|
||||||
|
*/
|
||||||
|
$ret['header'] = 'https://picsum.photos/seed/' . hash('ripemd128', $ret['url']) . '/960/300';
|
||||||
|
}
|
||||||
|
|
||||||
$uriid = ItemURI::insert(['uri' => $ret['url'], 'guid' => $guid]);
|
$uriid = ItemURI::insert(['uri' => $ret['url'], 'guid' => $guid]);
|
||||||
|
|
||||||
if (!$update) {
|
if (!$update) {
|
||||||
|
|
Loading…
Reference in a new issue