Some systems return an array instead of a string for the followers/following
This commit is contained in:
parent
d6905e29cf
commit
2722c8e595
|
@ -1326,7 +1326,16 @@ class GContact
|
||||||
DBA::update('gfollower', ['deleted' => true], ['gcid' => $gcid]);
|
DBA::update('gfollower', ['deleted' => true], ['gcid' => $gcid]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$contacts = array_unique(array_merge($followers, $followings));
|
$contacts = [];
|
||||||
|
foreach (array_merge($followers, $followings) as $contact) {
|
||||||
|
if (is_string($contact)) {
|
||||||
|
$contacts[] = $contact;
|
||||||
|
} elseif (!empty($contact['url']) && is_string($contact['url'])) {
|
||||||
|
$contacts[] = $contact['url'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$contacts = array_unique($contacts);
|
||||||
|
|
||||||
Logger::info('Discover AP contacts', ['url' => $url, 'contacts' => count($contacts)]);
|
Logger::info('Discover AP contacts', ['url' => $url, 'contacts' => count($contacts)]);
|
||||||
foreach ($contacts as $contact) {
|
foreach ($contacts as $contact) {
|
||||||
$gcontact = DBA::selectFirst('gcontact', ['id'], ['nurl' => Strings::normaliseLink(($contact))]);
|
$gcontact = DBA::selectFirst('gcontact', ['id'], ['nurl' => Strings::normaliseLink(($contact))]);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user