]> git.mxchange.org Git - friendica.git/commitdiff
Relocate check for announce
authorMichael <heluecht@pirati.ca>
Sun, 8 Dec 2019 22:04:32 +0000 (22:04 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 8 Dec 2019 22:04:32 +0000 (22:04 +0000)
src/Worker/Delivery.php
src/Worker/Notifier.php

index 0d01d82848714023e76a3bb24cc153d37831907e..da0c8f2adb4da018364f11cfff755c212a0ec5e2 100644 (file)
@@ -16,7 +16,6 @@ use Friendica\Protocol\DFRN;
 use Friendica\Protocol\Diaspora;
 use Friendica\Protocol\Email;
 use Friendica\Protocol\Activity;
-use Friendica\Protocol\ActivityPub;
 use Friendica\Util\Strings;
 use Friendica\Util\Network;
 use Friendica\Core\Worker;
@@ -252,13 +251,6 @@ class Delivery extends BaseObject
         */
        private static function deliverDFRN($cmd, $contact, $owner, $items, $target_item, $public_message, $top_level, $followup)
        {
-               // Skip transmitting the announce via DFRN when it had already been done via AP
-               if (ActivityPub\Transmitter::isAnnounce($target_item) && !empty(Model\APContact::getByURL($contact['url'], false))) {
-                       Logger::info('Announce had already been transmitted', ['url' => $contact['url'], 'guid' => ($target_item['guid'] ?? '') ?: $target_item['id']]);
-                       Model\ItemDeliveryData::incrementQueueDone($target_item['id']);
-                       return;
-               }
-
                // Transmit Diaspora reshares via Diaspora if the Friendica contact support Diaspora
                if (Diaspora::isReshare($target_item['body']) && !empty(Diaspora::personByHandle(contact['addr'], false))) {
                        Logger::info('Reshare will be transmitted via Diaspora', ['url' => $contact['url'], 'guid' => ($target_item['guid'] ?? '') ?: $target_item['id']]);
index 3e4efb5f3c4877568d913b84a3095eb0c0c0da35..19bd51885667d24de462a575237a6e3bbd37b4b1 100644 (file)
@@ -625,6 +625,11 @@ class Notifier
                        return false;
                }
 
+               // We deliver reshares via AP whenever possible
+               if (ActivityPub\Transmitter::isAnnounce($item)) {
+                       return true;
+               }
+
                // Skip DFRN when the item will be (forcefully) delivered via AP
                if (Config::get('debug', 'total_ap_delivery') && ($contact['network'] == Protocol::DFRN) && !empty(APContact::getByURL($contact['url'], false))) {
                        return true;