コミットを比較

...

3 コミット

4個のファイルの変更17行の追加3行の削除

ファイルの表示

@ -142,7 +142,7 @@ class ActivityPubPlugin extends Plugin
// Keep conversation tree
return Notice::getByUri($object['id']);
} catch (Exception $e) {
// NOOP
common_debug('ActivityPubPlugin Notice Grabber: failed to find object-id: ' . $object['id']);
}
return Activitypub_notice::create_notice($object, $acclaimed_actor_profile);
} else {

ファイルの表示

@ -391,7 +391,9 @@ class Activitypub_inbox_handler
*/
private function handle_undo_like()
{
$notice = ActivityPubPlugin::grab_notice_from_url($this->activity['id']);
$object = $this->activity['object'];
$notice_url = $object['object'];
$notice = ActivityPubPlugin::grab_notice_from_url($notice_url);
Fave::removeEntry($this->actor, $notice);
}

ファイルの表示

@ -46,12 +46,18 @@ class Activitypub_like
*/
public static function like_to_array(string $actor, Notice $notice): array
{
if ($notice->hasParent() && Notice::getByID($notice->reply_to)) {
$object = Activitypub_notice::getUri($notice->getParent());
} else {
// When unlike.
$object = Activitypub_notice::getUri($notice);
}
$res = [
'@context' => 'https://www.w3.org/ns/activitystreams',
'id' => Activitypub_notice::getUri($notice),
'type' => 'Like',
'actor' => $actor,
'object' => Activitypub_notice::getUri($notice->getParent()),
'object' => $object,
];
return $res;
}

ファイルの表示

@ -150,6 +150,12 @@ class Activitypub_notice
$url = isset($object['url']) ? $object['url'] : $id; // string
$content = $object['content']; // string
// Avoid duplication
if (is_numeric($id) && Notice::getByID((int)$id)) {
common_debug('create_notice: not found $id' . $id);
return null;
}
// possible keys: ['inReplyTo', 'latitude', 'longitude']
$settings = [];
if (isset($object['inReplyTo'])) {