From 3286641f3cd887b193c35ba8cd5bcc3b194bbcf1 Mon Sep 17 00:00:00 2001 From: floatingghost Date: Sun, 6 Nov 2022 22:52:25 +0000 Subject: [PATCH] Add software info on hover (#194) Co-authored-by: FloatingGhost Reviewed-on: https://akkoma.dev/AkkomaGang/pleroma-fe/pulls/194 --- src/components/status/status.js | 10 ++++++++++ src/components/status/status.vue | 1 + .../entity_normalizer/entity_normalizer.service.js | 3 +++ 3 files changed, 14 insertions(+) diff --git a/src/components/status/status.js b/src/components/status/status.js index a794b284..a35b5084 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -460,6 +460,16 @@ const Status = { return 'globe' } }, + faviconAlt (status) { + if (!status.user.instance) { + return '' + } + const software = ((status.user.instance) && (status.user.instance.nodeinfo) && (status.user.instance.nodeinfo.software)) || {} + if (software.name) { + return `${status.user.instance.name} (${software.name || ''} ${software.version || ''})` + } + return '' + }, showError (error) { this.error = error }, diff --git a/src/components/status/status.vue b/src/components/status/status.vue index a160d197..ceb66c21 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -177,6 +177,7 @@ v-if="!!(status.user && status.user.favicon)" class="status-favicon" :src="status.user.favicon" + :title="faviconAlt(status)" > diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index a2fa741f..689afb8b 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -88,6 +88,9 @@ export const parseUser = (data) => { output.friends_count = data.following_count output.bot = data.bot + if (data.akkoma) { + output.instance = data.akkoma.instance + } if (data.pleroma) { const relationship = data.pleroma.relationship