]> git.mxchange.org Git - friendica.git/blobdiff - mod/subthread.php
Merge pull request #7893 from annando/api-attachments
[friendica.git] / mod / subthread.php
index 9fa1a410d37130eff5ad646e84f840c0c1011ba5..aa65b86218dfc99af5425267d8d47b8c9c941281 100644 (file)
@@ -2,24 +2,27 @@
 /**
  * @file mod/subthread.php
  */
+
 use Friendica\App;
 use Friendica\Core\Hook;
 use Friendica\Core\L10n;
 use Friendica\Core\Logger;
+use Friendica\Core\Session;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\Item;
+use Friendica\Protocol\Activity;
 use Friendica\Util\Security;
 use Friendica\Util\Strings;
 use Friendica\Util\XML;
 
 function subthread_content(App $a) {
 
-       if (!local_user() && !remote_user()) {
+       if (!Session::isAuthenticated()) {
                return;
        }
 
-       $activity = ACTIVITY_FOLLOW;
+       $activity = Activity::FOLLOW;
 
        $item_id = (($a->argc > 1) ? Strings::escapeTags(trim($a->argv[1])) : 0);
 
@@ -86,7 +89,7 @@ function subthread_content(App $a) {
        $uri = Item::newURI($owner_uid);
 
        $post_type = (($item['resource-id']) ? L10n::t('photo') : L10n::t('status'));
-       $objtype = (($item['resource-id']) ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE );
+       $objtype = (($item['resource-id']) ? Activity\ObjectType::IMAGE : Activity\ObjectType::NOTE );
        $link = XML::escape('<link rel="alternate" type="text/html" href="' . System::baseUrl() . '/display/' . $item['guid'] . '" />' . "\n");
        $body = $item['body'];