Skip to content

Commit

Permalink
Add tip for v1/4 post
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack-Works committed Apr 12, 2019
1 parent 22657d5 commit f2f48a7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/extension/background-script/CryptoService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,11 @@ async function decryptFrom(
const [version, ownersAESKeyEncrypted, salt, encryptedText, signature] = encrypted.split('|')
if (!version || !ownersAESKeyEncrypted || !salt || !encryptedText || !signature)
throw new TypeError('This post is not complete, you need to view the full post.')
// 1/4 === version 41, has dropped.
// 2/4 === version 40
if (version !== '2/4') throw new TypeError('Unknown post type')
if (version === '1/4')
throw new TypeError('We have dropped support for preview version 🎼1/4. Tell your friend to update Maskbook!')
if (version !== '2/4') throw new TypeError('Unknown post version, maybe you should update Maskbook?')
if (!ownersAESKeyEncrypted || !salt || !encryptedText || !signature) throw new TypeError('Invalid post')
async function getKey(name: string) {
let key = await queryPersonCryptoKey(by)
Expand Down

0 comments on commit f2f48a7

Please sign in to comment.