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/20] 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/20] 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/20] 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") {
From 2bcb381aa73201b3c5d1e0bb8ab9cf04816535c6 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Sat, 27 May 2017 14:19:34 +0100
Subject: [PATCH 17/20] maybe window focus should be ignored so focus is left
as what it was but with this at least clicking on a text input will not make
you be thrown into composer instead
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
src/components/structures/MatrixChat.js | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js
index 0de38ab226..a4b6b3ea6c 100644
--- a/src/components/structures/MatrixChat.js
+++ b/src/components/structures/MatrixChat.js
@@ -906,7 +906,9 @@ module.exports = React.createClass({
},
onFocus: function(ev) {
- dis.dispatch({action: 'focus_composer'});
+ if (document.activeElement.textLength === undefined) {
+ dis.dispatch({action: 'focus_composer'});
+ }
},
showScreen: function(screen, params) {
From 4cd7964b584bf88e4cf3e6cb6438b2c592324478 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Sat, 27 May 2017 18:43:59 +0100
Subject: [PATCH 18/20] remove window onFocus handling entirely
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
src/components/structures/MatrixChat.js | 7 -------
1 file changed, 7 deletions(-)
diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js
index 6638431410..4b05d746f3 100644
--- a/src/components/structures/MatrixChat.js
+++ b/src/components/structures/MatrixChat.js
@@ -247,7 +247,6 @@ module.exports = React.createClass({
UDEHandler.startListening();
this.focusComposer = false;
- window.addEventListener("focus", this.onFocus);
// this can technically be done anywhere but doing this here keeps all
// the routing url path logic together.
@@ -910,12 +909,6 @@ module.exports = React.createClass({
});
},
- onFocus: function(ev) {
- if (document.activeElement.textLength === undefined) {
- dis.dispatch({action: 'focus_composer'});
- }
- },
-
showScreen: function(screen, params) {
if (screen == 'register') {
dis.dispatch({
From a30110b5d3e06c22b3f1769b04e33b83e9649c31 Mon Sep 17 00:00:00 2001
From: Marcel
Date: Sat, 27 May 2017 21:11:00 +0200
Subject: [PATCH 19/20] Fix vector-im/riot-web#4042
---
src/components/structures/UserSettings.js | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js
index 993586df84..992830066f 100644
--- a/src/components/structures/UserSettings.js
+++ b/src/components/structures/UserSettings.js
@@ -546,11 +546,13 @@ module.exports = React.createClass({
},
onLanguageChange: function(l) {
- UserSettingsStore.setLocalSetting('language', l);
- this.setState({
- language: l,
- });
- PlatformPeg.get().reload();
+ if(this.state.language !== l) {
+ UserSettingsStore.setLocalSetting('language', l);
+ this.setState({
+ language: l,
+ });
+ PlatformPeg.get().reload();
+ }
},
_renderLanguageSetting: function () {
From 8935e9706ebc7cbfc056f6fc396b335d071d2b59 Mon Sep 17 00:00:00 2001
From: Marcel
Date: Sat, 27 May 2017 21:21:23 +0200
Subject: [PATCH 20/20] Change variable name as mentioned by t3chguy
---
src/components/structures/UserSettings.js | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js
index 992830066f..f4bf8b18cb 100644
--- a/src/components/structures/UserSettings.js
+++ b/src/components/structures/UserSettings.js
@@ -545,11 +545,11 @@ module.exports = React.createClass({
);
},
- onLanguageChange: function(l) {
- if(this.state.language !== l) {
- UserSettingsStore.setLocalSetting('language', l);
+ onLanguageChange: function(newLang) {
+ if(this.state.language !== newLang) {
+ UserSettingsStore.setLocalSetting('language', newLang);
this.setState({
- language: l,
+ language: newLang,
});
PlatformPeg.get().reload();
}