Skip to content
Snippets Groups Projects

Reply to message

Merged Emmanuel Vodor requested to merge 262_reply_to_message into beta
1 file
+ 7
4
Compare changes
  • Side-by-side
  • Inline
@@ -14,9 +14,8 @@ converse.plugins.add('sib-reply-to-message', {
@@ -14,9 +14,8 @@ 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 not from a MUC
// Do not add if the message is from the current user
// 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;
return buttons;
}
}
@@ -32,8 +31,12 @@ converse.plugins.add('sib-reply-to-message', {
@@ -32,8 +31,12 @@ converse.plugins.add('sib-reply-to-message', {
chat_textarea.value += `${message.replace(/^/gm, '>')}\n`;
chat_textarea.value += `${message.replace(/^/gm, '>')}\n`;
}
}
// Add mention to the initial user and focus textarea
// Add mention to the initial author for MUCs
chat_textarea.value += `@${el.model.get('nick')} `;
const nickname = el.model.get('nick');
 
if (el.model.get('type') === 'groupchat' && nickname.length) {
 
chat_textarea.value += `@${nickname} `;
 
}
 
chat_textarea.focus();
chat_textarea.focus();
},
},
'button_class': 'chat-msg__action-reply',
'button_class': 'chat-msg__action-reply',
Loading