Skip to content
Snippets Groups Projects
Commit da64392f authored by ubermanu's avatar ubermanu
Browse files

bugfix: allow users to reply to their own messages

parent 74614b89
No related branches found
No related tags found
2 merge requests!114bugfix: allow users to reply to their own messages,!113History, Reply to messages and RAI
...@@ -13,12 +13,6 @@ converse.plugins.add('sib-reply-to-message', { ...@@ -13,12 +13,6 @@ converse.plugins.add('sib-reply-to-message', {
} }
api.listen.on('getMessageActionButtons', (el, buttons) => { 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({ buttons.push({
'i18n_text': __('Reply'), 'i18n_text': __('Reply'),
'handler': ev => { 'handler': ev => {
...@@ -32,8 +26,9 @@ converse.plugins.add('sib-reply-to-message', { ...@@ -32,8 +26,9 @@ converse.plugins.add('sib-reply-to-message', {
} }
// Add mention to the initial author for MUCs // 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'); 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} `; chat_textarea.value += `@${nickname} `;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment