]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/ActivityPub/Processor.php
Remove entries from queue / relay detection
[friendica.git] / src / Protocol / ActivityPub / Processor.php
index c6420436e8eeb9d4ac72e549055e4f82199efe6c..e6ff43f06acd807e53c1a260e21a5c26931d0a45 100644 (file)
@@ -223,6 +223,8 @@ class Processor
                Post\History::add($item['uri-id'], $item);
                Item::update($item, ['uri' => $activity['id']]);
 
+               Receiver::removeFromQueue($activity);
+
                if ($activity['object_type'] == 'as:Event') {
                        $posts = Post::select(['event-id', 'uid'], ["`uri` = ? AND `event-id` > ?", $activity['id'], 0]);
                        while ($post = DBA::fetch($posts)) {
@@ -426,6 +428,7 @@ class Processor
 
                Logger::info('Deleting item', ['object' => $activity['object_id'], 'owner'  => $owner]);
                Item::markForDeletion(['uri' => $activity['object_id'], 'owner-id' => $owner]);
+               Receiver::removeFromQueue($activity);
        }
 
        /**
@@ -543,6 +546,7 @@ class Processor
                Logger::debug('Add post to featured collection', ['uri-id' => $uriid]);
 
                Post\Collection::add($uriid, Post\Collection::FEATURED);
+               Receiver::removeFromQueue($activity);
        }
 
        /**
@@ -560,6 +564,7 @@ class Processor
                Logger::debug('Remove post from featured collection', ['uri-id' => $uriid]);
 
                Post\Collection::remove($uriid, Post\Collection::FEATURED);
+               Receiver::removeFromQueue($activity);
        }
 
        /**
@@ -890,6 +895,7 @@ class Processor
                        $item_id = Item::insert($item);
                        if ($item_id) {
                                Logger::info('Item insertion successful', ['user' => $item['uid'], 'item_id' => $item_id]);
+                               Receiver::removeFromQueue($activity);
                        } else {
                                Logger::notice('Item insertion aborted', ['user' => $item['uid']]);
                        }
@@ -1348,6 +1354,7 @@ class Processor
 
                Logger::info('Updating profile', ['object' => $activity['object_id']]);
                Contact::updateFromProbeByURL($activity['object_id']);
+               Receiver::removeFromQueue($activity);
        }
 
        /**
@@ -1376,6 +1383,7 @@ class Processor
                DBA::close($contacts);
 
                Logger::info('Deleted contact', ['object' => $activity['object_id']]);
+               Receiver::removeFromQueue($activity);
        }
 
        /**
@@ -1458,6 +1466,7 @@ class Processor
                $condition = ['id' => $cid];
                Contact::update($fields, $condition);
                Logger::info('Accept contact request', ['contact' => $cid, 'user' => $uid]);
+               Receiver::removeFromQueue($activity);
        }
 
        /**
@@ -1491,6 +1500,7 @@ class Processor
                } else {
                        Logger::info('Rejected contact request', ['contact' => $cid, 'user' => $uid]);
                }
+               Receiver::removeFromQueue($activity);
        }
 
        /**
@@ -1516,6 +1526,7 @@ class Processor
                }
 
                Item::markForDeletion(['uri' => $activity['object_id'], 'author-id' => $author_id, 'gravity' => GRAVITY_ACTIVITY]);
+               Receiver::removeFromQueue($activity);
        }
 
        /**
@@ -1552,6 +1563,7 @@ class Processor
 
                Contact::removeFollower($contact);
                Logger::info('Undo following request', ['contact' => $cid, 'user' => $uid]);
+               Receiver::removeFromQueue($activity);
        }
 
        /**