From d70928792d34b6da6ef3af3db2d9da7a269c5435 Mon Sep 17 00:00:00 2001 From: dave Date: Fri, 22 Mar 2019 13:15:11 -0400 Subject: #448 - fix timeline fetch error when status text is null --- src/services/entity_normalizer/entity_normalizer.service.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/services/entity_normalizer/entity_normalizer.service.js') diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index e831963a..57a6adf9 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -293,5 +293,5 @@ export const parseNotification = (data) => { const isNsfw = (status) => { const nsfwRegex = /#nsfw/i - return (status.tags || []).includes('nsfw') || !!status.text.match(nsfwRegex) + return (status.tags || []).includes('nsfw') || !!(status.text || '').match(nsfwRegex) } -- cgit v1.2.3-70-g09d2 From 909c315a44a5c6272f000325e5e9c8b33e75f873 Mon Sep 17 00:00:00 2001 From: taehoon Date: Sun, 17 Mar 2019 23:23:59 -0400 Subject: Get correct mimetype through entity_normalizer --- src/components/post_status_form/post_status_form.js | 2 +- src/services/entity_normalizer/entity_normalizer.service.js | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'src/services/entity_normalizer/entity_normalizer.service.js') diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 142d9d90..1f0df35a 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -292,7 +292,7 @@ const PostStatusForm = { this.submitDisabled = false }, type (fileInfo) { - return fileTypeService.fileType(fileInfo.pleroma.mime_type) + return fileTypeService.fileType(fileInfo.mimetype) }, paste (e) { if (e.clipboardData.files.length > 0) { diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index 57a6adf9..0d653207 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -128,13 +128,12 @@ export const parseUser = (data) => { return output } -const parseAttachment = (data) => { +export const parseAttachment = (data) => { const output = {} const masto = !data.hasOwnProperty('oembed') if (masto) { - // Not exactly same... - output.mimetype = data.type + output.mimetype = data.pleroma.mime_type output.meta = data.meta // not present in BE yet } else { output.mimetype = data.mimetype -- cgit v1.2.3-70-g09d2 From 6fdbc182ca722dbb12d92e4bf26e841ccda8303d Mon Sep 17 00:00:00 2001 From: taehoon Date: Sun, 17 Mar 2019 23:42:07 -0400 Subject: Add fallback for attachments uploaded via the other platforms --- src/services/entity_normalizer/entity_normalizer.service.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/services/entity_normalizer/entity_normalizer.service.js') diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index 0d653207..35c28ec0 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -133,7 +133,8 @@ export const parseAttachment = (data) => { const masto = !data.hasOwnProperty('oembed') if (masto) { - output.mimetype = data.pleroma.mime_type + // Not exactly same... + output.mimetype = data.pleroma ? data.pleroma.mime_type : data.type output.meta = data.meta // not present in BE yet } else { output.mimetype = data.mimetype -- cgit v1.2.3-70-g09d2 From 932652e335d19cc6f97fae1a9b12501ffdb9ec0b Mon Sep 17 00:00:00 2001 From: taehoon Date: Mon, 25 Mar 2019 12:19:33 -0400 Subject: Update attachment normalizer --- src/services/entity_normalizer/entity_normalizer.service.js | 1 + 1 file changed, 1 insertion(+) (limited to 'src/services/entity_normalizer/entity_normalizer.service.js') diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index 35c28ec0..5cac3463 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -136,6 +136,7 @@ export const parseAttachment = (data) => { // Not exactly same... output.mimetype = data.pleroma ? data.pleroma.mime_type : data.type output.meta = data.meta // not present in BE yet + output.id = data.id } else { output.mimetype = data.mimetype // output.meta = ??? missing -- cgit v1.2.3-70-g09d2