]> git.mxchange.org Git - friendica.git/blobdiff - mod/follow.php
Improved description
[friendica.git] / mod / follow.php
index 8e08d7a72ce0131b5f4417a7243be953a9543065..db7a52b2c32c5c9d088b4418775fa8d999be0aed 100644 (file)
@@ -23,7 +23,6 @@ use Friendica\App;
 use Friendica\Content\Widget;
 use Friendica\Core\Protocol;
 use Friendica\Core\Renderer;
-use Friendica\Core\Session;
 use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Model\Profile;
@@ -36,7 +35,7 @@ use Friendica\Util\Strings;
 
 function follow_post(App $a)
 {
-       if (!Session::getLocalUser()) {
+       if (!DI::userSession()->getLocalUserId()) {
                throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
        }
 
@@ -53,13 +52,13 @@ function follow_content(App $a)
 {
        $return_path = 'contact';
 
-       if (!Session::getLocalUser()) {
+       if (!DI::userSession()->getLocalUserId()) {
                DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
                DI::baseUrl()->redirect($return_path);
                // NOTREACHED
        }
 
-       $uid = Session::getLocalUser();
+       $uid = DI::userSession()->getLocalUserId();
 
        $url = Probe::cleanURI(trim($_REQUEST['url'] ?? ''));
 
@@ -196,7 +195,7 @@ function follow_process(App $a, string $url)
 
 function follow_remote_item($url)
 {
-       $item_id = Item::fetchByLink($url, Session::getLocalUser());
+       $item_id = Item::fetchByLink($url, DI::userSession()->getLocalUserId());
        if (!$item_id) {
                // If the user-specific search failed, we search and probe a public post
                $item_id = Item::fetchByLink($url);