- Worker::add(['priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true],
- 'Delivery', $cmd, $item_id, (int)$contact['id']);
+
+ // Ensure that posts with our own protocol arrives before Diaspora posts arrive.
+ // Situation is that sometimes Friendica servers receive Friendica posts over the Diaspora protocol first.
+ // The conversion in Markdown reduces the formatting, so these posts should arrive after the Friendica posts.
+ if ($contact['network'] == Protocol::DIASPORA) {
+ $deliver_options = ['priority' => $a->queue['priority'], 'dont_fork' => true];
+ } else {
+ $deliver_options = ['priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true];
+ }
+ Worker::add($deliver_options, 'Delivery', $cmd, $item_id, (int)$contact['id']);