From: Hypolite Petovan Date: Fri, 5 May 2023 03:32:29 +0000 (-0400) Subject: [twitter] Return null in the probe_detect hook result key on unsuccessful probe X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f5d8604e596f8f50f5e6fa281827c196cbc8148f;p=friendica-addons.git [twitter] Return null in the probe_detect hook result key on unsuccessful probe - Add authoritative probe result setting --- diff --git a/twitter/twitter.php b/twitter/twitter.php index c55489a0..aaa378d1 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -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'] = []; } }