Fix some Inbox Create Bugs

This commit is contained in:
Diogo Cordeiro 2018-08-01 18:01:34 +01:00
parent 8b860d6da2
commit 12e5dc4b59
2 changed files with 2 additions and 8 deletions

View File

@ -97,9 +97,7 @@ class apActorInboxAction extends ManagedAction
'as:Public' 'as:Public'
]; ];
$to_profiles = [ActivityPubPlugin::actor_uri($profile), $to_profiles = [$profile];
'https://www.w3.org/ns/activitystreams#Public'
];
// Process request // Process request
switch ($data->type) { switch ($data->type) {

View File

@ -76,14 +76,10 @@ if (isset($data->object->inReplyTo)) {
$discovery = new Activitypub_explorer; $discovery = new Activitypub_explorer;
if ($to_profiles == ['https://www.w3.org/ns/activitystreams#Public']) {
$to_profiles = [];
}
// Generate Cc objects // Generate Cc objects
if (isset($data->object->cc) && is_array($data->object->cc)) { if (isset($data->object->cc) && is_array($data->object->cc)) {
// Remove duplicates from Cc actors set // Remove duplicates from Cc actors set
array_unique($data->object->to); array_unique($data->object->cc);
foreach ($data->object->cc as $cc_url) { foreach ($data->object->cc as $cc_url) {
try { try {
$to_profiles = array_merge($to_profiles, $discovery->lookup($cc_url)); $to_profiles = array_merge($to_profiles, $discovery->lookup($cc_url));