Skip to content
Snippets Groups Projects
Commit e42a84c9 authored by Emmanuel Vodor's avatar Emmanuel Vodor
Browse files

Merge branch '262_reply_to_message' into 'beta'

Reply to message

See merge request !112
parents c81dee09 74614b89
No related branches found
No related tags found
2 merge requests!113History, Reply to messages and RAI,!112Reply to message
Pipeline #10479 passed
......@@ -14,9 +14,8 @@ converse.plugins.add('sib-reply-to-message', {
api.listen.on('getMessageActionButtons', (el, buttons) => {
// Do not add if the message is not from a MUC
// Do not add if the message is from the current user
if (el.model.get('type') !== 'groupchat' || el.model.get('sender') === 'me') {
if (el.model.get('sender') === 'me') {
return buttons;
}
......@@ -32,8 +31,12 @@ converse.plugins.add('sib-reply-to-message', {
chat_textarea.value += `${message.replace(/^/gm, '>')}\n`;
}
// Add mention to the initial user and focus textarea
chat_textarea.value += `@${el.model.get('nick')} `;
// Add mention to the initial author for MUCs
const nickname = el.model.get('nick');
if (el.model.get('type') === 'groupchat' && nickname.length) {
chat_textarea.value += `@${nickname} `;
}
chat_textarea.focus();
},
'button_class': 'chat-msg__action-reply',
......
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