diff options
| author | Henry Jameson <me@hjkos.com> | 2021-06-22 20:16:26 +0300 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2021-06-22 20:16:26 +0300 |
| commit | a258182522e85c31fe9dfbfbddf7a314ca36d0ca (patch) | |
| tree | dd30275e114325700ae8b068e015d5b4c0cde437 /src/components/status_body | |
| parent | c6831a381033fa160fba95fa88b1179d3c670d9d (diff) | |
fix non-notifying mentions and original mention display
Diffstat (limited to 'src/components/status_body')
| -rw-r--r-- | src/components/status_body/status_body.js | 14 | ||||
| -rw-r--r-- | src/components/status_body/status_body.vue | 3 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/components/status_body/status_body.js b/src/components/status_body/status_body.js index 601c963b..d1736ba3 100644 --- a/src/components/status_body/status_body.js +++ b/src/components/status_body/status_body.js @@ -85,6 +85,20 @@ const StatusContent = { }) }, methods: { + onParseReady (event) { + this.$emit('parseReady', event) + const { writtenMentions } = event + writtenMentions + .filter(mention => !mention.notifying) + .forEach(mention => { + const { content, url } = mention + const cleanedString = content.replace(/<[^>]+?>/gi, '') // remove all tags + if (!cleanedString.startsWith('@')) return + const handle = cleanedString.slice(1) + const host = url.replace(/^https?:\/\//, '').replace(/\/.+?$/, '') + this.$store.dispatch('fetchUserIfMissing', `${handle}@${host}`) + }) + }, toggleShowMore () { if (this.mightHideBecauseTall) { this.showingTall = !this.showingTall diff --git a/src/components/status_body/status_body.vue b/src/components/status_body/status_body.vue index 2be46303..d77ccd54 100644 --- a/src/components/status_body/status_body.vue +++ b/src/components/status_body/status_body.vue @@ -47,7 +47,8 @@ :handle-links="true" :hide-mentions="hideMentions" :greentext="mergedConfig.greentext" - @parseReady="$emit('parseReady', $event)" + :attentions="status.attentions" + @parseReady="onParseReady" /> <button |
