]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Item.php
Merge pull request #8934 from annando/fix-fatal
[friendica.git] / src / Model / Item.php
index b5a954099117e471c90ac553f1a049c6a1f4087e..d8fbac8307d18065e19f9c7bd5a7963e77828108 100644 (file)
@@ -1554,9 +1554,7 @@ class Item
                        }
 
                        // Update the contact relations
-                       if ($item['author-id'] != $parent['author-id']) {
-                               DBA::update('contact-relation', ['last-interaction' => $item['created']], ['cid' => $parent['author-id'], 'relation-cid' => $item['author-id']], true);
-                       }
+                       ContactRelation::store($parent['author-id'], $item['author-id'], $item['created']);
                }
 
                return $item;
@@ -1703,6 +1701,10 @@ class Item
                        'photo' => $item['owner-avatar'], 'network' => $item['network']];
                $item['owner-id'] = ($item['owner-id'] ?? 0) ?: Contact::getIdForURL($item['owner-link'], 0, null, $default);
 
+               // Ensure that there is an avatar cache
+               Contact::checkAvatarCache($item['author-id']);
+               Contact::checkAvatarCache($item['owner-id']);
+
                // The contact-id should be set before "self::insert" was called - but there seems to be issues sometimes
                $item["contact-id"] = self::contactId($item);