From da64392f4786ca2cc20933904f372f32196dee9c Mon Sep 17 00:00:00 2001
From: ubermanu <e.vodor@gmail.com>
Date: Mon, 15 Mar 2021 19:41:29 +0100
Subject: [PATCH] bugfix: allow users to reply to their own messages

---
 src/plugins/sib-reply-to-message.js | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/plugins/sib-reply-to-message.js b/src/plugins/sib-reply-to-message.js
index 1d878ce..982528e 100644
--- a/src/plugins/sib-reply-to-message.js
+++ b/src/plugins/sib-reply-to-message.js
@@ -13,12 +13,6 @@ converse.plugins.add('sib-reply-to-message', {
     }
 
     api.listen.on('getMessageActionButtons', (el, buttons) => {
-
-      // Do not add if the message is from the current user
-      if (el.model.get('sender') === 'me') {
-        return buttons;
-      }
-
       buttons.push({
         'i18n_text': __('Reply'),
         'handler': ev => {
@@ -32,8 +26,9 @@ converse.plugins.add('sib-reply-to-message', {
           }
 
           // Add mention to the initial author for MUCs
+          // Do not add the mention if you were the author of the original message
           const nickname = el.model.get('nick');
-          if (el.model.get('type') === 'groupchat' && nickname.length) {
+          if (el.model.get('type') === 'groupchat' && el.model.get('sender') !== 'me' && nickname.length) {
             chat_textarea.value += `@${nickname} `;
           }
 
-- 
GitLab