diff --git a/package.json b/package.json index c26289712c..6ea6a5d879 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "highlight.js": "^8.9.1", "linkifyjs": "^2.0.0-beta.4", "marked": "^0.3.5", - "matrix-js-sdk": "^0.5.0", + "matrix-js-sdk": "matrix-org/matrix-js-sdk#develop", "optimist": "^0.6.1", "q": "^1.4.1", "react": "^0.14.2", diff --git a/src/components/views/rooms/MessageComposer.js b/src/components/views/rooms/MessageComposer.js index bd84fd85be..947f27331c 100644 --- a/src/components/views/rooms/MessageComposer.js +++ b/src/components/views/rooms/MessageComposer.js @@ -91,6 +91,14 @@ module.exports = React.createClass({ var TintableSvg = sdk.getComponent("elements.TintableSvg"); var MessageComposerInput = sdk.getComponent("rooms.MessageComposerInput"); + var controls = []; + + controls.push( +
+ +
+ ); + var callButton, videoCallButton, hangupButton; if (this.props.callState && this.props.callState !== 'ended') { hangupButton = @@ -109,25 +117,47 @@ module.exports = React.createClass({ } + var canSendMessages = this.props.room.currentState.maySendMessage( + MatrixClientPeg.get().credentials.userId); + + if (canSendMessages) { + // This also currently includes the call buttons. Really we should + // check separately for whether we can call, but this is slightly + // complex because of conference calls. + var uploadButton = ( +
+ + +
+ ); + + controls.push( + , + uploadButton, + hangupButton, + callButton, + videoCallButton, + ); + } else { + controls.push( +
+ You do not have permission to post to this room +
+ ); + } + return ( -
-
-
-
- +
+
+
+ {controls}
- -
- - -
- { hangupButton } - { callButton } - { videoCallButton }
-
); } });