From 1f3f6e2b926f6281b4ce76e2b5028451a2989c28 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Wed, 12 Apr 2023 00:32:14 +0000 Subject: [PATCH] Show audio: references inline, too, and now we don't have to show audio: and video: in the references section. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4254 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- apps/ssb/tf-message.js | 5 +---- apps/ssb/tf-utils.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/apps/ssb/tf-message.js b/apps/ssb/tf-message.js index 40a48ec9..f8a50aa6 100644 --- a/apps/ssb/tf-message.js +++ b/apps/ssb/tf-message.js @@ -168,10 +168,7 @@ class TfMessageElement extends LitElement { render_mentions() { let mentions = this.message?.content?.mentions || []; - mentions = mentions.filter(x => - x.name?.startsWith('audio:') || - x.name?.startsWith('video:') || - this.message?.content?.text?.indexOf(x.link) === -1); + mentions = mentions.filter(x => this.message?.content?.text?.indexOf(x.link) === -1); if (mentions.length) { let self = this; return html` diff --git a/apps/ssb/tf-utils.js b/apps/ssb/tf-utils.js index de09a431..aa209a29 100644 --- a/apps/ssb/tf-utils.js +++ b/apps/ssb/tf-utils.js @@ -13,6 +13,16 @@ function image(node, entering) { this.disableTags -= 1; this.lit(''); } + } else if (node.firstChild?.type === 'text' && + node.firstChild.literal.startsWith('audio:')) { + if (entering) { + this.lit(''); + } } else { if (entering) { if (this.disableTags === 0) {