Skip to content

Commit

Permalink
Custom emojis on actors
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlia committed Oct 13, 2024
1 parent b8c247c commit b456353
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/federation/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ federation
value,
}),
),
tags: Object.entries(account.emojis).map(
([shortcode, url]) =>
new Emoji({
id: ctx.getObjectUri(Emoji, { shortcode }),
name: `:${shortcode.replace(/^:|:$/g, "")}:`,
icon: new Image({ url: new URL(url) }),
}),
),
});
})
.setKeyPairsDispatcher(async (_ctx, identifier) => {
Expand Down
2 changes: 1 addition & 1 deletion src/federation/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ export function toObject(
([shortcode, url]) =>
new Emoji({
id: ctx.getObjectUri(Emoji, { shortcode }),
name: `:${shortcode}:`,
name: `:${shortcode.replace(/^:|:$/g, "")}:`,
icon: new Image({ url: new URL(url) }),
}),
),
Expand Down

0 comments on commit b456353

Please sign in to comment.