[twitter] Return null in the probe_detect hook result key on unsuccessful probe
- Add authoritative probe result setting
This commit is contained in:
parent
a0574ab045
commit
f5d8604e59
|
@ -526,7 +526,12 @@ function twitter_probe_detect(array &$hookData)
|
||||||
$user = twitter_fetchuser($nick);
|
$user = twitter_fetchuser($nick);
|
||||||
|
|
||||||
if ($user) {
|
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'] = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue