From a6a162177b8347917494ddd18de9d239b15bd7fa Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 11 Mar 2019 23:03:55 +0200 Subject: instead of filtering nulls, let's just not have them in the first place --- .../entity_normalizer/entity_normalizer.service.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (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 d20ce77f..7c840552 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -39,10 +39,10 @@ export const parseUser = (data) => { return output } - output.name = null // missing + // output.name = ??? missing output.name_html = data.display_name - output.description = null // missing + // output.description = ??? missing output.description_html = data.note // Utilize avatar_static for gif avatars? @@ -83,7 +83,7 @@ export const parseUser = (data) => { output.friends_count = data.friends_count - output.bot = null // missing + // output.bot = ??? missing output.statusnet_profile_url = data.statusnet_profile_url @@ -134,7 +134,7 @@ const parseAttachment = (data) => { output.meta = data.meta // not present in BE yet } else { output.mimetype = data.mimetype - output.meta = null // missing + // output.meta = ??? missing } output.url = data.url @@ -166,7 +166,7 @@ export const parseStatus = (data) => { output.in_reply_to_user_id = data.in_reply_to_account_id // Missing!! fix in UI? - output.in_reply_to_screen_name = null + // output.in_reply_to_screen_name = ??? // Not exactly the same but works output.statusnet_conversation_id = data.id @@ -179,8 +179,7 @@ export const parseStatus = (data) => { output.summary_html = data.spoiler_text output.external_url = data.url - // FIXME missing!! - output.is_local = false + // output.is_local = ??? missing } else { output.favorited = data.favorited output.fave_num = data.fave_num @@ -259,7 +258,7 @@ export const parseNotification = (data) => { if (masto) { output.type = mastoDict[data.type] || data.type - output.seen = null // missing + // output.seen = ??? missing output.status = parseStatus(data.status) output.action = output.status // not sure output.from_profile = parseUser(data.account) -- cgit v1.2.3-70-g09d2 From b9877a4323ab0025c14a8126eb2f6268a4bea6ac Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 11 Mar 2019 23:08:14 +0200 Subject: actually use embedded relationship if it's present --- src/services/entity_normalizer/entity_normalizer.service.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (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 7c840552..37c1f544 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -59,10 +59,13 @@ export const parseUser = (data) => { output.statusnet_profile_url = data.url if (data.pleroma) { - const pleroma = data.pleroma - output.follows_you = pleroma.follows_you - output.statusnet_blocking = pleroma.statusnet_blocking - output.muted = pleroma.muted + const relationship = data.pleroma.relationship + + if (relationship) { + output.follows_you = relationship.follows_you + output.statusnet_blocking = relationship.statusnet_blocking + output.muted = relationship.muted + } } // Missing, trying to recover -- cgit v1.2.3-70-g09d2 From ce8b5fcd11aed0dedf8dd8c16190e9f1a826da2d Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 12 Mar 2019 21:49:03 +0200 Subject: fix embedded relationship card parsing --- src/services/entity_normalizer/entity_normalizer.service.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (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 37c1f544..9f9db563 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -62,9 +62,10 @@ export const parseUser = (data) => { const relationship = data.pleroma.relationship if (relationship) { - output.follows_you = relationship.follows_you - output.statusnet_blocking = relationship.statusnet_blocking - output.muted = relationship.muted + output.follows_you = relationship.followed_by + output.following = relationship.following + output.statusnet_blocking = relationship.blocking + output.muted = relationship.muting } } -- cgit v1.2.3-70-g09d2