]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/Diaspora.php
Use User:: API insteadd of direct database read
[friendica.git] / src / Protocol / Diaspora.php
index ac1cf9c38d469793b7d7179de1cca1a0707167b0..f7d94256eeaea5ffd654ab39b62686d49fe25a1b 100644 (file)
@@ -2148,13 +2148,9 @@ class Diaspora
                        if ($comment['id'] == $comment['parent']) {
                                continue;
                        }
-                       if ($comment['verb'] == ACTIVITY_POST) {
-                               $cmd = $comment['self'] ? Delivery::COMMENT : 'comment-import';
-                       } else {
-                               $cmd = $comment['self'] ? Delivery::ACTIVITY : 'activity-import';
-                       }
-                       Logger::log("Send ".$cmd." for item ".$comment['id']." to contact ".$contact_id, Logger::DEBUG);
-                       Worker::add(PRIORITY_HIGH, 'Delivery', $cmd, $comment['id'], $contact_id);
+
+                       Logger::info('Deliver participation', ['item' => $comment['id'], 'contact' => $contact_id]);
+                       Worker::add(PRIORITY_HIGH, 'Delivery', Delivery::POST, $comment['id'], $contact_id);
                }
                DBA::close($comments);
 
@@ -3547,7 +3543,7 @@ class Diaspora
                $public = ($item["private"] ? "false" : "true");
 
                $created = DateTimeFormat::utc($item["created"], DateTimeFormat::ATOM);
-               $edited = DateTimeFormat::utc($item["edited"], DateTimeFormat::ATOM);
+               $edited = DateTimeFormat::utc($item["edited"] ?? $item["created"], DateTimeFormat::ATOM);
 
                // Detect a share element and do a reshare
                if (!$item['private'] && ($ret = self::isReshare($item["body"]))) {