]> git.mxchange.org Git - friendica.git/blobdiff - mod/tagger.php
Only fetch the needed field
[friendica.git] / mod / tagger.php
index f3fe3b88618c66e8825ed51c9d16de58b5ad5e35..dae9cbc2bc76a0ad81053d0240fd4a2a34caa582 100644 (file)
@@ -22,7 +22,6 @@
 use Friendica\App;
 use Friendica\Core\Hook;
 use Friendica\Core\Logger;
-use Friendica\Core\Session;
 use Friendica\Core\System;
 use Friendica\Core\Worker;
 use Friendica\Database\DBA;
@@ -37,7 +36,7 @@ use Friendica\Worker\Delivery;
 
 function tagger_content(App $a)
 {
-       if (!Session::isAuthenticated()) {
+       if (!DI::userSession()->isAuthenticated()) {
                return;
        }
 
@@ -63,13 +62,13 @@ function tagger_content(App $a)
 
        $owner_uid = $item['uid'];
 
-       if (local_user() != $owner_uid) {
+       if (DI::userSession()->getLocalUserId() != $owner_uid) {
                return;
        }
 
-       $contact = Contact::selectFirst([], ['self' => true, 'uid' => local_user()]);
+       $contact = Contact::selectFirst([], ['self' => true, 'uid' => DI::userSession()->getLocalUserId()]);
        if (!DBA::isResult($contact)) {
-               Logger::warning('Self contact not found.', ['uid' => local_user()]);
+               Logger::warning('Self contact not found.', ['uid' => DI::userSession()->getLocalUserId()]);
                return;
        }
 
@@ -135,7 +134,7 @@ EOT;
                'author-name'   => $contact['name'],
                'author-link'   => $contact['url'],
                'author-avatar' => $contact['thumb'],
-               'body'          => sprintf( $bodyverb, $ulink, $alink, $plink, $termlink),
+               'body'          => sprintf($bodyverb, $ulink, $alink, $plink, $termlink),
                'verb'          => Activity::TAG,
                'target-type'   => $targettype,
                'target'        => $target,