diff options
| author | HJ <30-hj@users.noreply.git.pleroma.social> | 2019-03-25 19:21:48 +0000 |
|---|---|---|
| committer | HJ <30-hj@users.noreply.git.pleroma.social> | 2019-03-25 19:21:48 +0000 |
| commit | 04217fc6604ff6c4454ba0291c081a927a46d03c (patch) | |
| tree | e802758f03cf83e8089cbfa7fcec1aa520f43387 /src/services/entity_normalizer/entity_normalizer.service.js | |
| parent | fe13b1b75a42d03a813072633194f89385acec8e (diff) | |
| parent | 854d0e80512d2da80cd5153144698a5148da4aa6 (diff) | |
Merge branch 'develop' into 'mastoapi/friends-tl'
# Conflicts:
# src/services/api/api.service.js
Diffstat (limited to 'src/services/entity_normalizer/entity_normalizer.service.js')
| -rw-r--r-- | src/services/entity_normalizer/entity_normalizer.service.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index e831963a..5cac3463 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -128,14 +128,15 @@ 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 ? 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 @@ -293,5 +294,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) } |
