Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33051157
D7169.1768424127.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D7169.1768424127.diff
View Options
diff --git a/lib/media/media-utils.js b/lib/media/media-utils.js
--- a/lib/media/media-utils.js
+++ b/lib/media/media-utils.js
@@ -14,7 +14,8 @@
if (media.length === 0) {
return 'corrupted media';
} else if (media.length === 1) {
- return `a ${media[0].type}`;
+ const type = media[0].type.replace('encrypted_', '');
+ return `a ${type}`;
}
let firstType;
for (const single of media) {
@@ -28,6 +29,7 @@
}
}
invariant(firstType, 'there should be some media');
+ firstType = firstType.replace('encrypted_', '');
if (firstType === 'photo') {
firstType = 'image';
}
diff --git a/lib/shared/messages/multimedia-message-spec.js b/lib/shared/messages/multimedia-message-spec.js
--- a/lib/shared/messages/multimedia-message-spec.js
+++ b/lib/shared/messages/multimedia-message-spec.js
@@ -208,9 +208,19 @@
if (rawMessageInfo.type === messageTypes.IMAGES) {
return rawMessageInfo;
}
- if (hasMinCodeVersion(platformDetails, 158)) {
+
+ const containsEncryptedMedia = rawMessageInfo.media.some(
+ media =>
+ media.type === 'encrypted_photo' || media.type === 'encrypted_video',
+ );
+ if (!containsEncryptedMedia && hasMinCodeVersion(platformDetails, 158)) {
return rawMessageInfo;
}
+ // TODO: Change before landing
+ if (hasMinCodeVersion(platformDetails, 1000)) {
+ return rawMessageInfo;
+ }
+
const { id } = rawMessageInfo;
invariant(id !== null && id !== undefined, 'id should be set on server');
return {
@@ -246,6 +256,7 @@
};
} else if (unwrapped.type === messageTypes.MULTIMEDIA) {
for (const { type } of unwrapped.media) {
+ // TODO: add encrypted_photo and encrypted_video here when supported
if (type !== 'photo' && type !== 'video') {
return messageInfo;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jan 14, 8:55 PM (9 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5933972
Default Alt Text
D7169.1768424127.diff (1 KB)
Attached To
Mode
D7169: [lib] Shim encrypted multimedia
Attached
Detach File
Event Timeline
Log In to Comment