Custom reaction (#4517)
* Custom reaction
* increase limit of reactions/delete
* リアクションの場合は OS標準の絵文字を使用 を迂回する
* カスタムリアクションを無効にする設定
* fix
* disableCustomReaction --> enableEmojiReaction
* Avoid MFM rendering
* 🎨
* 🎨
* Auto accept
* custom emoji reaction
* Improve usability
* Extract emojiRegex
* Fix
* Clean up
* 🎨
* 🎨
* toDbReaction で reaction は必須に
あとフォールバックは like に
* Clean up
* Make required
* 3eb08748fe (r266241728)
* Refactor
* Allow null
This commit is contained in:
@@ -10,6 +10,8 @@ import { deliver } from '../../../queue';
|
||||
import { renderActivity } from '../../../remote/activitypub/renderer';
|
||||
import perUserReactionsChart from '../../../services/chart/per-user-reactions';
|
||||
import { IdentifiableError } from '../../../misc/identifiable-error';
|
||||
import { toDbReaction } from '../../../misc/reaction-lib';
|
||||
import fetchMeta from '../../../misc/fetch-meta';
|
||||
|
||||
export default async (user: IUser, note: INote, reaction: string) => {
|
||||
// Myself
|
||||
@@ -17,6 +19,9 @@ export default async (user: IUser, note: INote, reaction: string) => {
|
||||
throw new IdentifiableError('2d8e7297-1873-4c00-8404-792c68d7bef0', 'cannot react to my note');
|
||||
}
|
||||
|
||||
const meta = await fetchMeta();
|
||||
reaction = await toDbReaction(reaction, meta.enableEmojiReaction);
|
||||
|
||||
// Create reaction
|
||||
await NoteReaction.insert({
|
||||
createdAt: new Date(),
|
||||
|
Reference in New Issue
Block a user