diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js
index 25ec644787..c78a395185 100644
--- a/src/components/structures/MatrixChat.js
+++ b/src/components/structures/MatrixChat.js
@@ -119,8 +119,9 @@ module.exports = React.createClass({
collapse_rhs: false,
ready: false,
width: 10000,
- sideOpacity: 1.0,
+ leftOpacity: 1.0,
middleOpacity: 1.0,
+ rightOpacity: 1.0,
version: null,
newVersion: null,
@@ -547,29 +548,23 @@ module.exports = React.createClass({
});
break;
case 'hide_right_panel':
- this.was_rhs_collapsed = this.state.collapse_rhs;
this.setState({
collapse_rhs: true,
});
break;
case 'show_right_panel':
- this.was_rhs_collapsed = this.state.collapse_rhs;
this.setState({
collapse_rhs: false,
});
break;
- // sets the panel to its state before last show/hide event
- case 'restore_right_panel':
+ case 'ui_opacity': {
+ const sideDefault = payload.sideOpacity >= 0.0 ? payload.sideOpacity : 1.0;
this.setState({
- collapse_rhs: this.was_rhs_collapsed,
+ leftOpacity: payload.leftOpacity >= 0.0 ? payload.leftOpacity : sideDefault,
+ middleOpacity: payload.middleOpacity || 1.0,
+ rightOpacity: payload.rightOpacity >= 0.0 ? payload.rightOpacity : sideDefault,
});
- break;
- case 'ui_opacity':
- this.setState({
- sideOpacity: payload.sideOpacity,
- middleOpacity: payload.middleOpacity,
- });
- break;
+ break; }
case 'set_theme':
this._onSetTheme(payload.value);
break;
diff --git a/src/components/views/rooms/ForwardMessage.js b/src/components/views/rooms/ForwardMessage.js
index e5be89b2e0..cd57bb1ba1 100644
--- a/src/components/views/rooms/ForwardMessage.js
+++ b/src/components/views/rooms/ForwardMessage.js
@@ -34,11 +34,11 @@ module.exports = React.createClass({
componentWillMount: function() {
this._unmounted = false;
- dis.dispatch({action: 'hide_right_panel'});
dis.dispatch({
action: 'ui_opacity',
- sideOpacity: 1.0,
- middleOpacity: 0.3,
+ leftOpacity: 1.0,
+ rightOpacity: 0.3,
+ middleOpacity: 0.5,
});
},
@@ -50,7 +50,6 @@ module.exports = React.createClass({
componentWillUnmount: function() {
this._unmounted = true;
- dis.dispatch({action: 'restore_right_panel'});
dis.dispatch({
action: 'ui_opacity',
sideOpacity: 1.0,
From bf0fe637590897f1e43d39584cef4122a2cf8bf3 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Fri, 19 May 2017 00:20:51 +0100
Subject: [PATCH 14/16] don't know why I'm even tracking mounted state. Never
refd
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
src/components/views/rooms/ForwardMessage.js | 4 ----
1 file changed, 4 deletions(-)
diff --git a/src/components/views/rooms/ForwardMessage.js b/src/components/views/rooms/ForwardMessage.js
index cd57bb1ba1..c3cec6fb36 100644
--- a/src/components/views/rooms/ForwardMessage.js
+++ b/src/components/views/rooms/ForwardMessage.js
@@ -32,8 +32,6 @@ module.exports = React.createClass({
},
componentWillMount: function() {
- this._unmounted = false;
-
dis.dispatch({
action: 'ui_opacity',
leftOpacity: 1.0,
@@ -48,8 +46,6 @@ module.exports = React.createClass({
},
componentWillUnmount: function() {
- this._unmounted = true;
-
dis.dispatch({
action: 'ui_opacity',
sideOpacity: 1.0,
From 475646a2a73296f25f118ac945b969fa34396df2 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Fri, 19 May 2017 00:34:35 +0100
Subject: [PATCH 15/16] Change wording
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
src/components/views/rooms/ForwardMessage.js | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/components/views/rooms/ForwardMessage.js b/src/components/views/rooms/ForwardMessage.js
index c3cec6fb36..e478630303 100644
--- a/src/components/views/rooms/ForwardMessage.js
+++ b/src/components/views/rooms/ForwardMessage.js
@@ -85,10 +85,7 @@ module.exports = React.createClass({
render: function() {
return (
-
-
Select a room to send the message to
- Use the left sidebar Room List to select forwarding target
-
+ Please select the destination room for this message
);
},
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 16/16] 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") {