Changeset View
Changeset View
Standalone View
Standalone View
lib/shared/message-utils.js
Show First 20 Lines • Show All 249 Lines • ▼ Show 20 Lines | function createMediaMessageData( | ||||
input: MediaMessageDataCreationInput, | input: MediaMessageDataCreationInput, | ||||
options: { | options: { | ||||
+forceMultimediaMessageType?: boolean, | +forceMultimediaMessageType?: boolean, | ||||
} = defaultMediaMessageOptions, | } = defaultMediaMessageOptions, | ||||
): MultimediaMessageData { | ): MultimediaMessageData { | ||||
let allMediaArePhotos = true; | let allMediaArePhotos = true; | ||||
const photoMedia = []; | const photoMedia = []; | ||||
for (const singleMedia of input.media) { | for (const singleMedia of input.media) { | ||||
if (singleMedia.type === 'video') { | if (singleMedia.type !== 'photo') { | ||||
allMediaArePhotos = false; | allMediaArePhotos = false; | ||||
break; | break; | ||||
} else { | } else { | ||||
photoMedia.push(singleMedia); | photoMedia.push(singleMedia); | ||||
} | } | ||||
} | } | ||||
const { localID, threadID, creatorID, sidebarCreation } = input; | const { localID, threadID, creatorID, sidebarCreation } = input; | ||||
▲ Show 20 Lines • Show All 330 Lines • Show Last 20 Lines |