[twitter] Return null in the probe_detect hook result key on unsuccessful probe

- Add authoritative probe result setting
This commit is contained in:
Hypolite Petovan 2023-05-04 23:32:29 -04:00
parent a0574ab045
commit f5d8604e59

View file

@ -526,7 +526,12 @@ function twitter_probe_detect(array &$hookData)
$user = twitter_fetchuser($nick);
if ($user) {
$hookData['result'] = twitter_user_to_contact($user);
$hookData['result'] = twitter_user_to_contact($user) ?: null;
}
// Authoritative probe should set the result even if the probe was unsuccessful
if ($hookData['network'] == Protocol::TWITTER && empty($hookData['result'])) {
$hookData['result'] = [];
}
}