+ * @return int
+ */
+ public static function processReplyByUri(string $uri): int
+ {
+ $count = 0;
+ $entries = DBA::select('inbox-entry', ['id'], ["`in-reply-to-id` = ? AND `object-id` != ?", $uri, $uri]);
+ while ($entry = DBA::fetch($entries)) {
+ $count += 1;
+ self::process($entry['id'], false);
+ }
+ DBA::close($entries);
+ return $count;
+ }
+
+ /**
+ * Checks if there are children of the given uri
+ *
+ * @param string $uri
+ *
+ * @return bool
+ */
+ public static function hasChildren(string $uri): bool
+ {
+ return DBA::exists('inbox-entry', ["`in-reply-to-id` = ? AND `object-id` != ?", $uri, $uri]);
+ }
+
+ /**
+ * Prepare the queue entry.
+ * This is a test function that is used solely for development.
+ *
+ * @param integer $id
+ * @return array
+ */
+ public static function reprepareActivityById(int $id): array
+ {
+ $entry = DBA::selectFirst('inbox-entry', [], ['id' => $id]);
+ if (empty($entry)) {
+ return [];
+ }
+
+ $receiver = DBA::selectFirst('inbox-entry-receiver', ['uid'], ['queue-id' => $id]);
+ if (!empty($receiver)) {
+ $uid = $receiver['uid'];
+ } else {
+ $uid = 0;
+ }
+
+ $trust_source = $entry['trust'];
+
+ $data = json_decode($entry['activity'], true);
+ $activity = json_decode($data['raw'], true);
+
+ $ldactivity = JsonLD::compact($activity);
+ return [
+ 'data' => Receiver::prepareObjectData($ldactivity, $uid, $entry['push'], $trust_source),
+ 'trust' => $trust_source
+ ];
+ }
+
+ /**
+ * Set the trust for all untrusted entries.
+ * This is a test function that is used solely for development.
+ *