click on nicks to insert them into the MessageComposer

This commit is contained in:
Matthew Hodgson 2016-03-17 15:35:23 +00:00
parent a13513935b
commit c7ffb59374
2 changed files with 20 additions and 4 deletions

View file

@ -196,6 +196,15 @@ module.exports = React.createClass({
case 'focus_composer':
this.refs.textarea.focus();
break;
case 'insert_displayname':
if (this.refs.textarea.value) {
this.refs.textarea.value =
this.refs.textarea.value.replace(/( ?)$/, " " + payload.displayname);
}
else {
this.refs.textarea.value = payload.displayname + ": ";
}
break;
}
},