Skip to content
Snippets Groups Projects
Commit 9502915e authored by Gabriel Delavald's avatar Gabriel Delavald Committed by Rodrigo Nascimento
Browse files

Add reply box to quote and add quote on reply (#10437)

[NEW] Add message preview when quoting another message
parent c9c0d8d8
No related branches found
No related tags found
No related merge requests found
......@@ -103,6 +103,7 @@ Meteor.startup(function() {
action() {
const message = this._arguments[1];
const {input} = chatMessages[message.rid];
input.value = `@${ message.u.username } `;
$(input)
.focus()
.data('reply', message)
......@@ -263,14 +264,10 @@ Meteor.startup(function() {
action() {
const message = this._arguments[1];
const {input} = chatMessages[message.rid];
const url = RocketChat.MessageAction.getPermaLink(message._id);
const text = `[ ](${ url }) `;
if (input.value) {
input.value += input.value.endsWith(' ') ? '' : ' ';
}
input.value += text;
input.focus();
$(input).trigger('change').trigger('input');
$(input)
.focus()
.data('reply', message)
.trigger('dataChange');
},
condition(message) {
if (RocketChat.models.Subscriptions.findOne({rid: message.rid}) == null) {
......
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