mirror of
https://github.com/friendica/friendica
synced 2024-11-11 06:22:54 +00:00
Fix for receiving direct messages from Mastodon
This commit is contained in:
parent
d81b7c840e
commit
490e850b48
2 changed files with 8 additions and 7 deletions
|
@ -173,7 +173,7 @@ class Processor
|
||||||
$item['object-type'] = ACTIVITY_OBJ_COMMENT;
|
$item['object-type'] = ACTIVITY_OBJ_COMMENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($activity['id'] != $activity['reply-to-id']) && !Item::exists(['uri' => $activity['reply-to-id']])) {
|
if (empty($activity['directmessage']) && ($activity['id'] != $activity['reply-to-id']) && !Item::exists(['uri' => $activity['reply-to-id']])) {
|
||||||
Logger::log('Parent ' . $activity['reply-to-id'] . ' not found. Try to refetch it.');
|
Logger::log('Parent ' . $activity['reply-to-id'] . ' not found. Try to refetch it.');
|
||||||
self::fetchMissingActivity($activity['reply-to-id'], $activity);
|
self::fetchMissingActivity($activity['reply-to-id'], $activity);
|
||||||
}
|
}
|
||||||
|
|
|
@ -207,7 +207,13 @@ class Receiver
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
$object_data['object_id'] = $object_id;
|
$object_data['object_id'] = $object_id;
|
||||||
|
|
||||||
|
// Test if it is an answer to a mail
|
||||||
|
if (DBA::exists('mail', ['uri' => $object_data['reply-to-id']])) {
|
||||||
|
$object_data['directmessage'] = true;
|
||||||
|
} else {
|
||||||
$object_data['directmessage'] = JsonLD::fetchElement($activity, 'litepub:directMessage');
|
$object_data['directmessage'] = JsonLD::fetchElement($activity, 'litepub:directMessage');
|
||||||
|
}
|
||||||
|
|
||||||
// We had been able to retrieve the object data - so we can trust the source
|
// We had been able to retrieve the object data - so we can trust the source
|
||||||
$trust_source = true;
|
$trust_source = true;
|
||||||
|
@ -936,11 +942,6 @@ class Receiver
|
||||||
|
|
||||||
$object_data['receiver'] = self::getReceivers($object, $object_data['actor'], $object_data['tags']);
|
$object_data['receiver'] = self::getReceivers($object, $object_data['actor'], $object_data['tags']);
|
||||||
|
|
||||||
// Test if it is an answer to a mail
|
|
||||||
if (DBA::exists('mail', ['uri' => $object_data['reply-to-id']])) {
|
|
||||||
$object_data['directmessage'] = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Common object data:
|
// Common object data:
|
||||||
|
|
||||||
// Unhandled
|
// Unhandled
|
||||||
|
|
Loading…
Reference in a new issue