allow for sending arbitrary events, also override highlight with
event currently being forwarded while forwardingEvent is set Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
475646a2a7
commit
cc7edbf86d
2 changed files with 12 additions and 10 deletions
|
@ -26,7 +26,9 @@ module.exports = React.createClass({
|
|||
|
||||
propTypes: {
|
||||
currentRoomId: React.PropTypes.string.isRequired,
|
||||
content: React.PropTypes.object.isRequired,
|
||||
|
||||
/* the MatrixEvent to be forwarded */
|
||||
mxEvent: React.PropTypes.object.isRequired,
|
||||
|
||||
onCancelClick: React.PropTypes.func.isRequired,
|
||||
},
|
||||
|
@ -57,8 +59,9 @@ module.exports = React.createClass({
|
|||
|
||||
onAction: function(payload) {
|
||||
if (payload.action === 'view_room') {
|
||||
const event = this.props.mxEvent;
|
||||
const Client = MatrixClientPeg.get();
|
||||
Client.sendMessage(payload.room_id, this.props.content).done(() => {
|
||||
Client.sendEvent(payload.room_id, event.getType(), event.getContent()).done(() => {
|
||||
dis.dispatch({action: 'message_sent'});
|
||||
}, (err) => {
|
||||
if (err.name === "UnknownDeviceError") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue