]> git.mxchange.org Git - friendica.git/commitdiff
Only build tag and file when really needed
authorMichael <heluecht@pirati.ca>
Sun, 8 Jul 2018 05:44:35 +0000 (05:44 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 8 Jul 2018 05:44:35 +0000 (05:44 +0000)
src/Model/Item.php

index b5903b99990148c7adf944f85df7bfd8a2459943..8a96e544057c6e04eb5bb482934f7933c46426d1 100644 (file)
@@ -189,14 +189,16 @@ class Item extends BaseObject
                        }
                }
 
-               // Build the tag string out of the term entries
-               if (array_key_exists('tag', $row) && empty($row['tag'])) {
-                       $row['tag'] = Term::tagTextFromItemId($row['internal-iid']);
-               }
+               if (!array_key_exists('verb', $row) || in_array($row['verb'], ['', ACTIVITY_POST, ACTIVITY_SHARE])) {
+                       // Build the tag string out of the term entries
+                       if (array_key_exists('tag', $row) && empty($row['tag'])) {
+                               $row['tag'] = Term::tagTextFromItemId($row['internal-iid']);
+                       }
 
-               // Build the file string out of the term entries
-               if (array_key_exists('file', $row) && empty($row['file'])) {
-                       $row['file'] = Term::fileTextFromItemId($row['internal-iid']);
+                       // Build the file string out of the term entries
+                       if (array_key_exists('file', $row) && empty($row['file'])) {
+                               $row['file'] = Term::fileTextFromItemId($row['internal-iid']);
+                       }
                }
 
                // Remove internal fields