From 7c6fb36520d2d875928ebc1e793bad40f5115a75 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 23 Oct 2015 09:24:25 +0100 Subject: [PATCH 1/2] Let the tile contents specify whether it requires a sender profile or not. Fixes #250. --- src/skins/vector/views/molecules/EventAsTextTile.js | 12 ++++++------ src/skins/vector/views/molecules/EventTile.js | 4 +++- src/skins/vector/views/molecules/MessageTile.js | 6 ++++++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/skins/vector/views/molecules/EventAsTextTile.js b/src/skins/vector/views/molecules/EventAsTextTile.js index 445303e4..fe79dd3a 100644 --- a/src/skins/vector/views/molecules/EventAsTextTile.js +++ b/src/skins/vector/views/molecules/EventAsTextTile.js @@ -19,22 +19,22 @@ limitations under the License. var React = require('react'); var EventAsTextTileController = require('matrix-react-sdk/lib/controllers/molecules/EventAsTextTile') -var sdk = require('matrix-react-sdk') var TextForEvent = require('matrix-react-sdk/lib/TextForEvent'); module.exports = React.createClass({ displayName: 'EventAsTextTile', mixins: [EventAsTextTileController], - render: function() { - var MessageTimestamp = sdk.getComponent('atoms.MessageTimestamp'); - var MemberAvatar = sdk.getComponent('atoms.MemberAvatar'); + statics: { + needsSenderProfile: function() { + return false; + } + }, + render: function() { var text = TextForEvent.textForEvent(this.props.mxEvent); if (text == null || text.length == 0) return null; - var timestamp = this.props.last ? : null; - var avatar = this.props.mxEvent.sender ? : null; return (
{TextForEvent.textForEvent(this.props.mxEvent)} diff --git a/src/skins/vector/views/molecules/EventTile.js b/src/skins/vector/views/molecules/EventTile.js index 534af3c7..1b1642bd 100644 --- a/src/skins/vector/views/molecules/EventTile.js +++ b/src/skins/vector/views/molecules/EventTile.js @@ -114,7 +114,9 @@ module.exports = React.createClass({
); } - sender = ; + if (EventTileType.needsSenderProfile()) { + sender = ; + } } return (
diff --git a/src/skins/vector/views/molecules/MessageTile.js b/src/skins/vector/views/molecules/MessageTile.js index 5e835050..44f5b635 100644 --- a/src/skins/vector/views/molecules/MessageTile.js +++ b/src/skins/vector/views/molecules/MessageTile.js @@ -28,6 +28,12 @@ module.exports = React.createClass({ displayName: 'MessageTile', mixins: [MessageTileController], + statics: { + needsSenderProfile: function() { + return true; + } + }, + render: function() { var UnknownMessageTile = sdk.getComponent('molecules.UnknownMessageTile'); From d66427dddeaef572b44fd4436b15cfca6db4dcd8 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 23 Oct 2015 10:16:00 +0100 Subject: [PATCH 2/2] Relative-ize paths in webpack config: they're supposed to be relative but sometimes they aren't. --- webpack.config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index 7868699d..929e57d7 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -20,7 +20,8 @@ module.exports = { // removed which gives a tree with matrix-react-sdk and vector // trees smashed together, but this fixes everything being under // various levels of '.' and '..' - return info.resourcePath.replace(/^[\/\.]*/, ''); + // Also, sometimes the resource path is absolute. + return path.relative(process.cwd(), info.resourcePath).replace(/^[\/\.]*/, ''); } }, resolve: {