diff --git a/src/TextForEvent.js b/src/TextForEvent.js index 6438a9a1ad..fa78f9d61b 100644 --- a/src/TextForEvent.js +++ b/src/TextForEvent.js @@ -117,7 +117,10 @@ function textForTopicEvent(ev) { function textForRoomNameEvent(ev) { var senderDisplayName = ev.sender && ev.sender.name ? ev.sender.name : ev.getSender(); - + + if (!ev.getContent().name || ev.getContent().name.trim().length === 0) { + return _t('%(senderDisplayName)s removed the room name.', {senderDisplayName: senderDisplayName}); + } return _t('%(senderDisplayName)s changed the room name to %(roomName)s.', {senderDisplayName: senderDisplayName, roomName: ev.getContent().name}); } diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index e939510c72..77ea8d945a 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -1496,49 +1496,48 @@ module.exports = React.createClass({ const TimelinePanel = sdk.getComponent("structures.TimelinePanel"); if (!this.state.room) { - if (this.state.roomLoading) { - return ( -
- -
- ); + if (this.state.roomLoading) { + return ( +
+ +
+ ); + } else { + var inviterName = undefined; + if (this.props.oobData) { + inviterName = this.props.oobData.inviterName; + } + var invitedEmail = undefined; + if (this.props.thirdPartyInvite) { + invitedEmail = this.props.thirdPartyInvite.invitedEmail; } - else { - var inviterName = undefined; - if (this.props.oobData) { - inviterName = this.props.oobData.inviterName; - } - var invitedEmail = undefined; - if (this.props.thirdPartyInvite) { - invitedEmail = this.props.thirdPartyInvite.invitedEmail; - } - // We have no room object for this room, only the ID. - // We've got to this room by following a link, possibly a third party invite. - var room_alias = this.props.roomAddress[0] == '#' ? this.props.roomAddress : null; - return ( -
- + +
+ -
- -
-
- ); - } +
+
+ ); + } } var myUserId = MatrixClientPeg.get().credentials.userId; @@ -1622,13 +1621,15 @@ module.exports = React.createClass({ } let aux = null; - if (this.state.forwardingEvent !== null) { - aux = ; - } else if (this.state.editingRoomSettings) { + let hideCancel = false; + if (this.state.editingRoomSettings) { aux = ; } else if (this.state.uploadingRoomSettings) { aux = ; + } else if (this.state.forwardingEvent !== null) { + aux = ; } else if (this.state.searching) { + hideCancel = true; // has own cancel aux = ; } else if (!myMember || myMember.membership !== "join") { // We do have a room object for this room, but we're not currently in it. @@ -1641,6 +1642,7 @@ module.exports = React.createClass({ if (this.props.thirdPartyInvite) { invitedEmail = this.props.thirdPartyInvite.invitedEmail; } + hideCancel = true; aux = ( + onCancelClick={(aux && !hideCancel) ? this.onCancelClick : null} + onForgetClick={(myMember && myMember.membership === "leave") ? this.onForgetClick : null} + onLeaveClick={(myMember && myMember.membership === "join") ? this.onLeaveClick : null} + /> { auxPanel } { topUnreadMessagesBar } { messagePanel } diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 5abb27e2b7..527219b4a6 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -174,6 +174,7 @@ "%(senderName)s changed their profile picture.": "%(senderName)s changed their profile picture.", "%(senderName)s changed the power level of %(powerLevelDiffText)s.": "%(senderName)s changed the power level of %(powerLevelDiffText)s.", "%(senderDisplayName)s changed the room name to %(roomName)s.": "%(senderDisplayName)s changed the room name to %(roomName)s.", + "%(senderDisplayName)s removed the room name.": "%(senderDisplayName)s removed the room name.", "%(senderDisplayName)s changed the topic to \"%(topic)s\".": "%(senderDisplayName)s changed the topic to \"%(topic)s\".", "Changes to who can read history will only apply to future messages in this room": "Changes to who can read history will only apply to future messages in this room", "Changes your display nickname": "Changes your display nickname",