diff options
| author | Henry Jameson <me@hjkos.com> | 2021-06-10 12:08:31 +0300 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2021-06-10 12:29:58 +0300 |
| commit | aec867b30036fd039113e4197ca98566447efec6 (patch) | |
| tree | 556505243aff6bd951ef8115726f1dc2e03bfda7 /src/components/status | |
| parent | 566964992a394f1d0462557f70e284f2493d82bf (diff) | |
Moved greentext to RichContent, improved how first mentions are
restored, now shows mentions not uh, mention in post body
Diffstat (limited to 'src/components/status')
| -rw-r--r-- | src/components/status/status.js | 25 | ||||
| -rw-r--r-- | src/components/status/status.vue | 4 |
2 files changed, 23 insertions, 6 deletions
diff --git a/src/components/status/status.js b/src/components/status/status.js index 54472525..0498f28a 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -19,6 +19,7 @@ import generateProfileLink from 'src/services/user_profile_link_generator/user_p import { highlightClass, highlightStyle } from '../../services/user_highlighter/user_highlighter.js' import { muteWordHits } from '../../services/status_parser/status_parser.js' import { unescape, uniqBy } from 'lodash' +import { getHeadTailLinks } from 'src/components/rich_content/rich_content.jsx' import { library } from '@fortawesome/fontawesome-svg-core' import { @@ -166,17 +167,33 @@ const Status = { muteWordHits () { return muteWordHits(this.status, this.muteWords) }, - mentionsOwnLine () { - return this.mergedConfig.mentionsOwnLine + headTailLinks () { + return getHeadTailLinks(this.status.raw_html) }, mentions () { return this.status.attentions.filter(attn => { return attn.screen_name !== this.replyToName && attn.screen_name !== this.status.user.screen_name + }).map(attn => ({ + url: attn.statusnet_profile_url, + content: attn.screen_name, + userId: attn.id + })) + }, + alsoMentions () { + const set = new Set(this.headTailLinks.writtenMentions.map(m => m.url)) + return this.headTailLinks.writtenMentions.filter(mention => { + return !set.has(mention.url) }) }, - hasMentions () { - return this.mentions.length > 0 + mentionsLine () { + return this.mentionsOwnLine ? this.mentions : this.alsoMentions + }, + mentionsOwnLine () { + return this.mergedConfig.mentionsOwnLine + }, + hasMentionsLine () { + return this.mentionsLine.length > 0 }, muted () { if (this.statusoid.user.id === this.currentUser.id) return false diff --git a/src/components/status/status.vue b/src/components/status/status.vue index f27fbaa5..05d22232 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -294,7 +294,7 @@ </div> <div - v-if="hasMentions && mentionsOwnLine" + v-if="hasMentionsLine" class="heading-mentions-row" > <div @@ -316,7 +316,7 @@ </span> </span> <MentionsLine - :attentions="mentions" + :mentions="mentionsLine" class="mentions-line" /> </div> |
