Unverified Commit 70ce861c authored by Hong Minhee's avatar Hong Minhee
Browse files

Object's attributedTo prop now accept only Actor

parent dae1e24e
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -53,6 +53,15 @@ To be released.
     -  `Object.clone()` method's `images` option no more accepts `Link`
        objects.

 -  `Object`'s `attributedTo` property now accepts only `Actor` objects.

     -  `new Object()` constructor's `attributedTo` option now accepts only
        `Actor` objects.
     -  `Object.getAttributedTo()` method now returns only an `Actor` object.
     -  `Object.getAttributedTos()` method now returns only `Actor` objects.
     -  `Object.clone()` method's `attributedTo` option now accepts only
        `Actor` objects.

 -  `Activity`'s `object` property no more accepts `Link` objects.

     -  `new Activity()` constructor's `object` option no more accepts `Link`
+201 −162

File changed.

Preview size limit exceeded, changes collapsed.

+1 −3
Original line number Diff line number Diff line
@@ -10,7 +10,6 @@ import {
  Follow,
  getActorHandle,
  getActorTypeName,
  isActor,
  Link,
  Note,
  Person,
@@ -179,8 +178,7 @@ federation.setInboxListeners("/users/{handle}/inbox", "/inbox")
      if (object.id == null || object.content == null) return;
      const author = await object.getAttributedTo();
      if (
        !isActor(author) || author.id == null ||
        author.preferredUsername == null
        author == null || author.id == null || author.preferredUsername == null
      ) return;
      const comment: Omit<Comment, "postUuid"> = {
        id: object.id.href,
+76 −76

File changed.

Preview size limit exceeded, changes collapsed.

+5 −1
Original line number Diff line number Diff line
@@ -33,7 +33,11 @@ properties:
    The attributed entities might not be Actors.  For instance,
    an object might be attributed to the completion of another activity.
  range:
  - "https://www.w3.org/ns/activitystreams#Object"
  - "https://www.w3.org/ns/activitystreams#Application"
  - "https://www.w3.org/ns/activitystreams#Group"
  - "https://www.w3.org/ns/activitystreams#Organization"
  - "https://www.w3.org/ns/activitystreams#Person"
  - "https://www.w3.org/ns/activitystreams#Service"

- pluralName: audiences
  singularName: audience