diff options
| author | Henry Jameson <me@hjkos.com> | 2019-06-13 00:07:28 +0300 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2019-06-13 00:07:28 +0300 |
| commit | 77511a5338a36e824b2521ea972d654517d2aed0 (patch) | |
| tree | 428bde231ecc98cbe18153904d9a9aeba75e3be2 /src/services/entity_normalizer/entity_normalizer.service.js | |
| parent | e7a2a7267dbd8a4ee3d266d22249459d028569d6 (diff) | |
| parent | 9df99c5205b1cb560bb25c0dd81cc90acbde4d7f (diff) | |
Merge remote-tracking branch 'upstream/develop' into masto-register-app-secret
* upstream/develop:
Apply suggestion to src/services/entity_normalizer/entity_normalizer.service.js
i18n/Update Japanese translation
render modal at the root level using portal
install portal vue
Small improve of the who to follow panel layout
Fix/Small fix in the who to follow page
remove console spam
i18n
wire up user.description with masto api data
i18n/Add Japanese with kanji (2)
move drowdown menu to popper
notification controls: redesign entirely
entity normalizer: collapse data.pleroma if blocks
wire up notification settings
do not miss statusnet_profile_url of mentions
Translation to Hebrew of everything other than theme_helpers and style.
Translate up to settings.
mastoapi login works
Diffstat (limited to 'src/services/entity_normalizer/entity_normalizer.service.js')
| -rw-r--r-- | src/services/entity_normalizer/entity_normalizer.service.js | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index 46ca7602..0e55ed2a 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -33,6 +33,7 @@ export const parseUser = (data) => { if (masto) { output.screen_name = data.acct + output.statusnet_profile_url = data.url // There's nothing else to get if (mastoShort) { @@ -42,7 +43,7 @@ export const parseUser = (data) => { output.name = data.display_name output.name_html = addEmojis(data.display_name, data.emojis) - // output.description = ??? missing + output.description = data.note output.description_html = addEmojis(data.note, data.emojis) // Utilize avatar_static for gif avatars? @@ -56,8 +57,6 @@ export const parseUser = (data) => { output.bot = data.bot - output.statusnet_profile_url = data.url - if (data.pleroma) { const relationship = data.pleroma.relationship @@ -72,6 +71,23 @@ export const parseUser = (data) => { moderator: data.pleroma.is_moderator, admin: data.pleroma.is_admin } + // TODO: Clean up in UI? This is duplication from what BE does for qvitterapi + if (output.rights.admin) { + output.role = 'admin' + } else if (output.rights.moderator) { + output.role = 'moderator' + } else { + output.role = 'member' + } + } + + if (data.source) { + output.description = data.source.note + output.default_scope = data.source.privacy + if (data.source.pleroma) { + output.no_rich_text = data.source.pleroma.no_rich_text + output.show_role = data.source.pleroma.show_role + } } // TODO: handle is_local @@ -106,8 +122,6 @@ export const parseUser = (data) => { output.muted = data.muted - // QVITTER ONLY FOR NOW - // Really only applies to logged in user, really.. I THINK if (data.rights) { output.rights = { moderator: data.rights.delete_others_notice, @@ -135,15 +149,16 @@ export const parseUser = (data) => { if (data.pleroma) { output.follow_request_count = data.pleroma.follow_request_count - } - if (data.pleroma) { output.tags = data.pleroma.tags output.deactivated = data.pleroma.deactivated + + output.notification_settings = data.pleroma.notification_settings } output.tags = output.tags || [] output.rights = output.rights || {} + output.notification_settings = output.notification_settings || {} return output } |
