- // If webfinger wasn't successful then try it with the URL - possibly in the format https://...
- if (!$webfinger AND ($uri != $addr)) {
- $path = str_replace('{uri}', urlencode($uri), $link);
+ // Mastodon needs to have it with "acct:"
+ if (!$webfinger) {
+ $path = str_replace('{uri}', urlencode("acct:".$addr), $link);