Skip to content

Commit

Permalink
Object.emojiReactions property
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlia committed Dec 30, 2024
1 parent 6b1e5e7 commit acf76ef
Show file tree
Hide file tree
Showing 18 changed files with 734 additions and 139 deletions.
8 changes: 8 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ To be released.
- Added `ActorCallbackSetters.mapAlias()` method.
- Added `ActorAliasMapper` type.

- Added `emojiReactions` property to `Object` class in Activity Vocabulary
API.

- Added `Object.emojiReactionsId` property
- Added `Object.getEmojiReactions()` method.
- `new Object()` constructor now accepts `emojiReactions` option.
- `Object.clone()` method now accepts `emojiReactions` option.

- Added `-t`/`--traverse` option to the `fedify lookup` subcommand. [[#195]]

- Added `-S`/`--suppress-errors` option to the `fedify lookup` subcommand.
Expand Down
517 changes: 387 additions & 130 deletions src/codegen/__snapshots__/class.test.ts.snap

Large diffs are not rendered by default.

85 changes: 80 additions & 5 deletions src/federation/handler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,10 @@ test("handleObject()", async () => {
misskey: "https://misskey-hub.net/ns#",
quoteUri: "fedibird:quoteUri",
quoteUrl: "as:quoteUrl",
emojiReactions: {
"@id": "fedibird:emojiReactions",
"@type": "@id",
},
},
],
id: "https://example.com/users/someone/notes/123",
Expand Down Expand Up @@ -569,6 +573,10 @@ test("handleObject()", async () => {
misskey: "https://misskey-hub.net/ns#",
quoteUri: "fedibird:quoteUri",
quoteUrl: "as:quoteUrl",
emojiReactions: {
"@id": "fedibird:emojiReactions",
"@type": "@id",
},
},
],
id: "https://example.com/users/someone/notes/123",
Expand Down Expand Up @@ -766,17 +774,32 @@ test("handleCollection()", async () => {
_misskey_quote: "misskey:_misskey_quote",
quoteUri: "fedibird:quoteUri",
quoteUrl: "as:quoteUrl",
emojiReactions: {
"@id": "fedibird:emojiReactions",
"@type": "@id",
},
},
];
assertEquals(await response.json(), {
"@context": [
"https://www.w3.org/ns/activitystreams",
"https://w3id.org/security/data-integrity/v1",
{
toot: "http://joinmastodon.org/ns#",
misskey: "https://misskey-hub.net/ns#",
fedibird: "http://fedibird.com/ns#",
ChatMessage: "http://litepub.social/ns#ChatMessage",
Emoji: "toot:Emoji",
Hashtag: "as:Hashtag",
sensitive: "as:sensitive",
toot: "http://joinmastodon.org/ns#",
votersCount: "toot:votersCount",
_misskey_quote: "misskey:_misskey_quote",
quoteUri: "fedibird:quoteUri",
quoteUrl: "as:quoteUrl",
emojiReactions: {
"@id": "fedibird:emojiReactions",
"@type": "@id",
},
},
],
id: "https://example.com/users/someone",
Expand Down Expand Up @@ -862,10 +885,21 @@ test("handleCollection()", async () => {
"https://www.w3.org/ns/activitystreams",
"https://w3id.org/security/data-integrity/v1",
{
toot: "http://joinmastodon.org/ns#",
misskey: "https://misskey-hub.net/ns#",
fedibird: "http://fedibird.com/ns#",
ChatMessage: "http://litepub.social/ns#ChatMessage",
Emoji: "toot:Emoji",
Hashtag: "as:Hashtag",
sensitive: "as:sensitive",
toot: "http://joinmastodon.org/ns#",
votersCount: "toot:votersCount",
_misskey_quote: "misskey:_misskey_quote",
quoteUri: "fedibird:quoteUri",
quoteUrl: "as:quoteUrl",
emojiReactions: {
"@id": "fedibird:emojiReactions",
"@type": "@id",
},
},
],
id: "https://example.com/users/someone",
Expand Down Expand Up @@ -922,10 +956,21 @@ test("handleCollection()", async () => {
"https://www.w3.org/ns/activitystreams",
"https://w3id.org/security/data-integrity/v1",
{
toot: "http://joinmastodon.org/ns#",
misskey: "https://misskey-hub.net/ns#",
fedibird: "http://fedibird.com/ns#",
ChatMessage: "http://litepub.social/ns#ChatMessage",
Emoji: "toot:Emoji",
Hashtag: "as:Hashtag",
sensitive: "as:sensitive",
toot: "http://joinmastodon.org/ns#",
votersCount: "toot:votersCount",
_misskey_quote: "misskey:_misskey_quote",
quoteUri: "fedibird:quoteUri",
quoteUrl: "as:quoteUrl",
emojiReactions: {
"@id": "fedibird:emojiReactions",
"@type": "@id",
},
},
],
id: "https://example.com/users/someone",
Expand Down Expand Up @@ -978,10 +1023,21 @@ test("handleCollection()", async () => {
"https://www.w3.org/ns/activitystreams",
"https://w3id.org/security/data-integrity/v1",
{
toot: "http://joinmastodon.org/ns#",
misskey: "https://misskey-hub.net/ns#",
fedibird: "http://fedibird.com/ns#",
ChatMessage: "http://litepub.social/ns#ChatMessage",
Emoji: "toot:Emoji",
Hashtag: "as:Hashtag",
sensitive: "as:sensitive",
toot: "http://joinmastodon.org/ns#",
votersCount: "toot:votersCount",
_misskey_quote: "misskey:_misskey_quote",
quoteUri: "fedibird:quoteUri",
quoteUrl: "as:quoteUrl",
emojiReactions: {
"@id": "fedibird:emojiReactions",
"@type": "@id",
},
},
],
id: "https://example.com/users/someone?cursor=0",
Expand Down Expand Up @@ -1038,10 +1094,21 @@ test("handleCollection()", async () => {
"https://www.w3.org/ns/activitystreams",
"https://w3id.org/security/data-integrity/v1",
{
toot: "http://joinmastodon.org/ns#",
misskey: "https://misskey-hub.net/ns#",
fedibird: "http://fedibird.com/ns#",
ChatMessage: "http://litepub.social/ns#ChatMessage",
Emoji: "toot:Emoji",
Hashtag: "as:Hashtag",
sensitive: "as:sensitive",
toot: "http://joinmastodon.org/ns#",
votersCount: "toot:votersCount",
_misskey_quote: "misskey:_misskey_quote",
quoteUri: "fedibird:quoteUri",
quoteUrl: "as:quoteUrl",
emojiReactions: {
"@id": "fedibird:emojiReactions",
"@type": "@id",
},
},
],
id: "https://example.com/users/someone?cursor=2",
Expand Down Expand Up @@ -1231,6 +1298,10 @@ test("respondWithObject()", async () => {
misskey: "https://misskey-hub.net/ns#",
quoteUri: "fedibird:quoteUri",
quoteUrl: "as:quoteUrl",
emojiReactions: {
"@id": "fedibird:emojiReactions",
"@type": "@id",
},
},
],
id: "https://example.com/notes/1",
Expand Down Expand Up @@ -1271,6 +1342,10 @@ test("respondWithObjectIfAcceptable", async () => {
misskey: "https://misskey-hub.net/ns#",
quoteUri: "fedibird:quoteUri",
quoteUrl: "as:quoteUrl",
emojiReactions: {
"@id": "fedibird:emojiReactions",
"@type": "@id",
},
},
],
id: "https://example.com/notes/1",
Expand Down
4 changes: 2 additions & 2 deletions src/sig/proof.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ test("createProof()", async () => {
assertEquals(
proof.proofValue,
decodeHex(
"3bbedb606c2fa17d81e6ba700c9c2e84ea708304a9e6f3843882e37236006215" +
"51765bd8ef242e50bdc39fe56386954654bbf53750bfbe1f28dea2ecb85c2f0b",
"938622eea473de8223c31cd59f941251e620cd4e1fca9fcda7f37fcd7d27cf8f" +
"9b0f7f381938829d0fa4bb27095919ac8bc86a04e3013c6c3a10d6b73b8a300e",
),
);
assertEquals(proof.created, created);
Expand Down
Loading

0 comments on commit acf76ef

Please sign in to comment.