]> git.mxchange.org Git - friendica.git/commitdiff
We now store the conversation as well
authorMichael <heluecht@pirati.ca>
Sat, 23 Jul 2022 13:58:14 +0000 (13:58 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 23 Jul 2022 13:58:14 +0000 (13:58 +0000)
database.sql
doc/database/db_inbox-entry.md
src/Protocol/ActivityPub/Processor.php
src/Protocol/ActivityPub/Queue.php
static/dbstructure.config.php

index eb97ec307447a3b1e4085ae190176c202c0f8ff0..42624d4d1d62abb1b331ddbdda3effc981836f3e 100644 (file)
@@ -732,6 +732,7 @@ CREATE TABLE IF NOT EXISTS `inbox-entry` (
        `activity-id` varbinary(255) COMMENT 'id of the incoming activity',
        `object-id` varbinary(255) COMMENT '',
        `in-reply-to-id` varbinary(255) COMMENT '',
+       `conversation` varbinary(255) COMMENT '',
        `type` varchar(64) COMMENT 'Type of the activity',
        `object-type` varchar(64) COMMENT 'Type of the object activity',
        `object-object-type` varchar(64) COMMENT 'Type of the object\'s object activity',
index 91126919e919871904211eda86cb7207692e58c0..32dd1203dc9dc0da9309c18ee034c66b754bef4e 100644 (file)
@@ -12,6 +12,7 @@ Fields
 | activity-id        | id of the incoming activity          | varbinary(255) | YES  |     | NULL    |                |
 | object-id          |                                      | varbinary(255) | YES  |     | NULL    |                |
 | in-reply-to-id     |                                      | varbinary(255) | YES  |     | NULL    |                |
+| conversation       |                                      | varbinary(255) | YES  |     | NULL    |                |
 | type               | Type of the activity                 | varchar(64)    | YES  |     | NULL    |                |
 | object-type        | Type of the object activity          | varchar(64)    | YES  |     | NULL    |                |
 | object-object-type | Type of the object's object activity | varchar(64)    | YES  |     | NULL    |                |
index 9c7cfef77d815351b16211befb9cebef56b0a264..4b02ae8103939178d56102d2e6cb5cca2782d659 100644 (file)
@@ -695,7 +695,7 @@ class Processor
                                        Logger::warning('Unknown parent item.', ['uri' => $parent_uri]);
                                        return false;
                                }
-                               if (($parent['private'] == Item::PRIVATE) && ($parent['private'] != Item::PRIVATE)) {
+                               if (($item['private'] == Item::PRIVATE) && ($parent['private'] != Item::PRIVATE)) {
                                        Logger::warning('Item is private but the parent is not. Dropping.', ['item-uri' => $item['uri'], 'thr-parent' => $item['thr-parent']]);
                                        return false;
                                }
index 055a728dfbc5f72288322c81e73a82a752f959dd..279f2108b7f1bb3c11103cb8d448590f946b05e5 100644 (file)
@@ -57,6 +57,12 @@ class Queue
                        $fields['in-reply-to-id'] = $activity['reply-to-id'];
                }
 
+               if (!empty($activity['context'])) {
+                       $fields['conversation'] = $activity['context'];
+               } elseif(!empty($activity['conversation'])) {
+                       $fields['conversation'] = $activity['conversation'];
+               }
+
                if (!empty($activity['object_object_type'])) {
                        $fields['object-object-type'] = $activity['object_object_type'];
                }
index 74bcdc8161dfaf274c20c0284d01473344290dd9..0b6af9b13ab6711bf3dc3bcb0a03440ebcd2ce40 100644 (file)
@@ -791,6 +791,7 @@ return [
                        "activity-id" => ["type" => "varbinary(255)", "comment" => "id of the incoming activity"],
                        "object-id" => ["type" => "varbinary(255)", "comment" => ""],
                        "in-reply-to-id" => ["type" => "varbinary(255)", "comment" => ""],
+                       "conversation" => ["type" => "varbinary(255)", "comment" => ""],
                        "type" => ["type" => "varchar(64)", "comment" => "Type of the activity"],
                        "object-type" => ["type" => "varchar(64)", "comment" => "Type of the object activity"],
                        "object-object-type" => ["type" => "varchar(64)", "comment" => "Type of the object's object activity"],