]> git.mxchange.org Git - friendica.git/blobdiff - src/Object/Post.php
Group selection: Respect "pubmail" and ignore atchived or blocked contacts
[friendica.git] / src / Object / Post.php
index f9119ee032676eb85ab1e292eb4f4c9fd25f8eb8..5dbcfeeedec7ce7d482844abc3dd09082d8c79f6 100644 (file)
@@ -193,6 +193,8 @@ class Post extends BaseObject
                        if (DBA::isResult($parent)) {
                                $origin = $parent['origin'];
                        }
+               } elseif ($item['pinned']) {
+                       $pinned = L10n::t('pinned item');
                }
 
                if ($origin && ($item['id'] != $item['parent']) && ($item['network'] == Protocol::ACTIVITYPUB)) {
@@ -288,10 +290,6 @@ class Post extends BaseObject
 
                                if ($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) {
                                        if ($origin) {
-                                               if ($item['pinned']) {
-                                                       $pinned = L10n::t('pinned item');
-                                               }
-
                                                $ispinned = ($item['pinned'] ? 'pinned' : 'unpinned');
 
                                                $pin = [
@@ -380,6 +378,11 @@ class Post extends BaseObject
 
                $tags = Term::populateTagsFromItem($item);
 
+               $ago = Temporal::getRelativeDate($item['created']);
+               if (Config::get('system', 'show_received') && (abs(strtotime($item['created']) - strtotime($item['received'])) > Config::get('system', 'show_received_seconds'))) {
+                       $ago = L10n::t('%s (Received %s)', $ago, Temporal::getRelativeDate($item['received']));
+               }
+
                $tmp_item = [
                        'template'        => $this->getTemplate(),
                        'type'            => implode("", array_slice(explode("/", $item['verb']), -1)),
@@ -414,7 +417,7 @@ class Post extends BaseObject
                        'sparkle'         => $sparkle,
                        'title'           => $title_e,
                        'localtime'       => DateTimeFormat::local($item['created'], 'r'),
-                       'ago'             => $item['app'] ? L10n::t('%s from %s', Temporal::getRelativeDate($item['created']), $item['app']) : Temporal::getRelativeDate($item['created']),
+                       'ago'             => $item['app'] ? L10n::t('%s from %s', $ago, $item['app']) : $ago,
                        'app'             => $item['app'],
                        'created'         => Temporal::getRelativeDate($item['created']),
                        'lock'            => $lock,