diff options
author | Cyrille Bollu <cyrpub@bollu.be> | 2019-10-11 14:38:03 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2020-10-13 23:51:41 +0200 |
commit | b352892a3ffa7848ee849ccb2d5a0982db52d690 (patch) | |
tree | f5e89f7b94fcdf87edaef418377c0fca6bb65072 | |
parent | 9edfc83a8f4fdd2a4e338177a1a0d9d81e276ac9 (diff) |
FIX: Automatically adds the original post's author to the list of
recipients when composing a reply.
Signed-off-by: Cyrille Bollu <cyrpub@bollu.be>
-rw-r--r-- | src/components/Composer.vue | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/components/Composer.vue b/src/components/Composer.vue index f14a93a3..d039f38a 100644 --- a/src/components/Composer.vue +++ b/src/components/Composer.vue @@ -610,6 +610,7 @@ export default { mounted() { this.$root.$on('composer-reply', (data) => { this.replyTo = data + this.type = 'direct' }) }, methods: { @@ -737,7 +738,7 @@ export default { let contentHtml = element.innerHTML - // Extract mentions from content and create an array ot of them + // Extract mentions from content and create an array out of them let to = [] const mentionRegex = /<span class="mention"[^>]+><a[^>]+><img[^>]+>@([\w-_.]+@[\w-.]+)/g let match = null @@ -748,6 +749,11 @@ export default { } } while (match) + // Add author of original post in case of reply + if (this.replyTo !== null) { + to.push(this.replyTo.actor_info.account) + } + // Extract hashtags from content and create an array ot of them const hashtagRegex = />#([^<]+)</g let hashtags = [] |