mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 03:19:46 +00:00
reactionsController: filter out non-RGI reactions
This commit is contained in:
parent
ea1c06f0c3
commit
834c9f2171
1 changed files with 3 additions and 2 deletions
|
|
@ -96,8 +96,9 @@ const reactionsController: AppController = async (c) => {
|
|||
}
|
||||
|
||||
const events = await store.query([{ kinds: [7], '#e': [id], limit: 100 }])
|
||||
.then((events) => hydrateEvents({ events, store }))
|
||||
.then((events) => events.filter((event) => !emoji || event.content === emoji));
|
||||
.then((events) => events.filter(({ content }) => /^\p{RGI_Emoji}$/v.test(content)))
|
||||
.then((events) => events.filter((event) => !emoji || event.content === emoji))
|
||||
.then((events) => hydrateEvents({ events, store }));
|
||||
|
||||
/** Events grouped by emoji. */
|
||||
const byEmoji = events.reduce((acc, event) => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue