]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Item.php
Issue 9986: Improve contact search
[friendica.git] / src / Model / Item.php
index 48652a0e12fbf691f6ceea1bdb42b6bbed7c2838..6d55fd56658b53d3c795243eeefb8ca368453204 100644 (file)
@@ -94,9 +94,9 @@ class Item
                        'private', 'title', 'body', 'raw-body', 'location', 'coord', 'app',
                        'inform', 'deleted', 'extid', 'post-type', 'gravity',
                        'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid',
-                       'author-id', 'author-link', 'owner-id', 'owner-link', 'contact-uid',
+                       'author-id', 'author-link', 'author-name', 'author-avatar', 'owner-id', 'owner-link', 'contact-uid',
                        'signed_text', 'network', 'wall', 'contact-id', 'plink', 'forum_mode', 'origin',
-                       'thr-parent-id', 'parent-uri-id', 'postopts', 'pubmail', 
+                       'thr-parent-id', 'parent-uri-id', 'postopts', 'pubmail',
                        'event-created', 'event-edited', 'event-start', 'event-finish',
                        'event-summary', 'event-desc', 'event-location', 'event-type',
                        'event-nofinish', 'event-adjust', 'event-ignore', 'event-id'];
@@ -970,6 +970,10 @@ class Item
                        unset($item['event-id']);
                }
 
+               if (empty($item['causer-id'])) {
+                       unset($item['causer-id']);
+               }
+
                Post::insert($item['uri-id'], $item);
 
                if ($item['gravity'] == GRAVITY_PARENT) {
@@ -1499,6 +1503,10 @@ class Item
         */
        private static function getLanguage(array $item)
        {
+               if (!empty($item['language'])) {
+                       return $item['language'];
+               }
+
                if (!in_array($item['gravity'], [GRAVITY_PARENT, GRAVITY_COMMENT]) || empty($item['body'])) {
                        return '';
                }