From cc7edbf86d0154a7b4daa4a4c2bc27a7a8d3e77a Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Fri, 19 May 2017 01:29:11 +0100
Subject: [PATCH] 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>
---
src/components/structures/RoomView.js | 15 +++++++--------
src/components/views/rooms/ForwardMessage.js | 7 +++++--
2 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js
index 9a0534cac7..c7417eeafd 100644
--- a/src/components/structures/RoomView.js
+++ b/src/components/structures/RoomView.js
@@ -125,7 +125,7 @@ module.exports = React.createClass({
roomId: null,
roomLoading: true,
- forwardingMessage: null,
+ forwardingEvent: null,
editingRoomSettings: false,
uploadingRoomSettings: false,
numUnreadMessages: 0,
@@ -454,9 +454,9 @@ module.exports = React.createClass({
});
break;
- case 'forward_message':
+ case 'forward_event':
this.setState({
- forwardingMessage: payload.content,
+ forwardingEvent: payload.content,
});
break;
}
@@ -1203,7 +1203,7 @@ module.exports = React.createClass({
this.updateTint();
this.setState({
editingRoomSettings: false,
- forwardingMessage: null,
+ forwardingEvent: null,
});
dis.dispatch({action: 'focus_composer'});
},
@@ -1621,8 +1621,8 @@ module.exports = React.createClass({
}
let aux = null;
- if (this.state.forwardingMessage !== null) {
- aux = ;
+ if (this.state.forwardingEvent !== null) {
+ aux = ;
} else if (this.state.editingRoomSettings) {
aux = ;
} else if (this.state.uploadingRoomSettings) {
@@ -1742,14 +1742,13 @@ module.exports = React.createClass({
}
// console.log("ShowUrlPreview for %s is %s", this.state.room.roomId, this.state.showUrlPreview);
-
var messagePanel = (
{
+ Client.sendEvent(payload.room_id, event.getType(), event.getContent()).done(() => {
dis.dispatch({action: 'message_sent'});
}, (err) => {
if (err.name === "UnknownDeviceError") {