]> git.mxchange.org Git - friendica.git/blobdiff - mod/follow.php
Merge pull request #9194 from annando/additional-directions
[friendica.git] / mod / follow.php
index 97bf9fcf9a50f89752e5b35d6e1c33e4c33449dc..885730f07c511e995829476671c986a5f032f7e0 100644 (file)
@@ -62,7 +62,7 @@ function follow_post(App $a)
                DI::baseUrl()->redirect('contact/' . $result['cid']);
        }
 
-       info(DI::l10n()->t('The contact could not be added.'));
+       notice(DI::l10n()->t('The contact could not be added.'));
 
        DI::baseUrl()->redirect($return_path);
        // NOTREACHED
@@ -107,8 +107,14 @@ function follow_content(App $a)
                }
        }
 
-       $contact = Contact::getByURL($url, 0, [], true);
+       $contact = Contact::getByURL($url, true);
+
+       // Possibly it is a mail contact
        if (empty($contact)) {
+               $contact = Probe::uri($url, Protocol::MAIL, $uid);
+       }
+
+       if (empty($contact) || ($contact['network'] == Protocol::PHANTOM)) {
                // Possibly it is a remote item and not an account
                follow_remote_item($url);