Merge branch 'better-still-emoji' into proper-attachments

* better-still-emoji:
  fix non-notifying mentions and original mention display
  fix not escaping some stuff
  fix rich images
This commit is contained in:
Henry Jameson 2021-06-22 20:45:44 +03:00
commit dd3fe61cf3
7 changed files with 65 additions and 12 deletions

View file

@ -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