Merge remote-tracking branch 'origin/develop' into chats
This commit is contained in:
@@ -5,6 +5,8 @@ import {
|
||||
fromJS,
|
||||
} from 'immutable';
|
||||
|
||||
import { normalizeAttachment } from 'soapbox/normalizers/attachment';
|
||||
|
||||
import type { Attachment, Card, Emoji } from 'soapbox/types/entities';
|
||||
|
||||
export const ChatMessageRecord = ImmutableRecord({
|
||||
@@ -22,8 +24,14 @@ export const ChatMessageRecord = ImmutableRecord({
|
||||
pending: false,
|
||||
});
|
||||
|
||||
const normalizeMedia = (status: ImmutableMap<string, any>) => {
|
||||
return status.update('attachment', null, normalizeAttachment);
|
||||
};
|
||||
|
||||
export const normalizeChatMessage = (chatMessage: Record<string, any>) => {
|
||||
return ChatMessageRecord(
|
||||
ImmutableMap(fromJS(chatMessage)),
|
||||
ImmutableMap(fromJS(chatMessage)).withMutations(chatMessage => {
|
||||
normalizeMedia(chatMessage);
|
||||
}),
|
||||
);
|
||||
};
|
||||
|
||||
@@ -106,12 +106,12 @@ export const SoapboxConfigRecord = ImmutableRecord({
|
||||
limit: 1,
|
||||
}),
|
||||
aboutPages: ImmutableMap<string, ImmutableMap<string, unknown>>(),
|
||||
mobilePages: ImmutableMap<string, ImmutableMap<string, unknown>>(),
|
||||
authenticatedProfile: true,
|
||||
singleUserMode: false,
|
||||
singleUserModeProfile: '',
|
||||
linkFooterMessage: '',
|
||||
links: ImmutableMap<string, string>(),
|
||||
displayCta: true,
|
||||
}, 'SoapboxConfig');
|
||||
|
||||
type SoapboxConfigMap = ImmutableMap<string, any>;
|
||||
|
||||
Reference in New Issue
Block a user