diff options
Diffstat (limited to 'src/components/status_body/status_body.js')
| -rw-r--r-- | src/components/status_body/status_body.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/components/status_body/status_body.js b/src/components/status_body/status_body.js index 94366c6c..7ee965d9 100644 --- a/src/components/status_body/status_body.js +++ b/src/components/status_body/status_body.js @@ -86,6 +86,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 |
