コミットを比較
3 コミット
5f13240acf
...
2141674161
作成者 | SHA1 | 日付 |
---|---|---|
守矢諏訪子 | 2141674161 | |
senooken | ebc74ea00f | |
たかし | 8611b64d3f |
|
@ -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'])) {
|
||||
|
|
読み込み中…
新しいイシューから参照