diff --git a/app/soapbox/normalizers/__tests__/notification-test.js b/app/soapbox/normalizers/__tests__/notification-test.js new file mode 100644 index 0000000000..c90b5451ef Binary files /dev/null and b/app/soapbox/normalizers/__tests__/notification-test.js differ diff --git a/app/soapbox/normalizers/notification.ts b/app/soapbox/normalizers/notification.ts new file mode 100644 index 0000000000..ab369a52b2 --- /dev/null +++ b/app/soapbox/normalizers/notification.ts @@ -0,0 +1,20 @@ +import { + Map as ImmutableMap, + Record as ImmutableRecord, +} from 'immutable'; + +// https://docs.joinmastodon.org/entities/notification/ +const NotificationRecord = ImmutableRecord({ + account: null, + chat_message: null, // pleroma:chat_mention + created_at: new Date(), + emoji: null, // pleroma:emoji_reaction + id: '', + status: null, + target: null, // move + type: '', +}); + +export const normalizeNotification = (notification: ImmutableMap) => { + return NotificationRecord(notification); +};