mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-22 00:53:41 +00:00
[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
1 changed files with 6 additions and 1 deletions
|
@ -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