Merge branch 'develop' into luke/fix-get-users-rooms-for-joined-groups

This commit is contained in:
lukebarnard 2018-01-04 17:56:34 +00:00
commit f1b60287fb
7 changed files with 21 additions and 20 deletions

View file

@ -69,11 +69,11 @@ export function isOnlyCtrlOrCmdKeyEvent(ev) {
} }
} }
export function isCtrlOrCmdKeyEvent(ev) { export function isOnlyCtrlOrCmdIgnoreShiftKeyEvent(ev) {
const isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0; const isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0;
if (isMac) { if (isMac) {
return ev.metaKey && !ev.ctrlKey; return ev.metaKey && !ev.altKey && !ev.ctrlKey;
} else { } else {
return ev.ctrlKey && !ev.metaKey; return ev.ctrlKey && !ev.altKey && !ev.metaKey;
} }
} }

View file

@ -333,7 +333,6 @@ const LoggedInView = React.createClass({
<div className={bodyClasses}> <div className={bodyClasses}>
{ SettingsStore.isFeatureEnabled("feature_tag_panel") ? <TagPanel /> : <div /> } { SettingsStore.isFeatureEnabled("feature_tag_panel") ? <TagPanel /> : <div /> }
<LeftPanel <LeftPanel
selectedRoom={this.props.currentRoomId}
collapsed={this.props.collapseLhs || false} collapsed={this.props.collapseLhs || false}
disabled={this.props.leftDisabled} disabled={this.props.leftDisabled}
/> />

View file

@ -375,7 +375,7 @@ module.exports = React.createClass({
{ _t("For security, logging out will delete any end-to-end " + { _t("For security, logging out will delete any end-to-end " +
"encryption keys from this browser. If you want to be able " + "encryption keys from this browser. If you want to be able " +
"to decrypt your conversation history from future Riot sessions, " + "to decrypt your conversation history from future Riot sessions, " +
"please export your room keys for safe-keeping.") }. "please export your room keys for safe-keeping.") }
</div>, </div>,
button: _t("Sign out"), button: _t("Sign out"),
extraButtons: [ extraButtons: [

View file

@ -20,7 +20,7 @@ import classNames from 'classnames';
import { MatrixClient } from 'matrix-js-sdk'; import { MatrixClient } from 'matrix-js-sdk';
import sdk from '../../../index'; import sdk from '../../../index';
import dis from '../../../dispatcher'; import dis from '../../../dispatcher';
import { isCtrlOrCmdKeyEvent } from '../../../Keyboard'; import { isOnlyCtrlOrCmdIgnoreShiftKeyEvent } from '../../../Keyboard';
import FlairStore from '../../../stores/FlairStore'; import FlairStore from '../../../stores/FlairStore';
@ -76,7 +76,7 @@ export default React.createClass({
dis.dispatch({ dis.dispatch({
action: 'select_tag', action: 'select_tag',
tag: this.props.tag, tag: this.props.tag,
ctrlOrCmdKey: isCtrlOrCmdKeyEvent(e), ctrlOrCmdKey: isOnlyCtrlOrCmdIgnoreShiftKeyEvent(e),
shiftKey: e.shiftKey, shiftKey: e.shiftKey,
}); });
}, },

View file

@ -41,7 +41,6 @@ import AccessibleButton from '../elements/AccessibleButton';
import GeminiScrollbar from 'react-gemini-scrollbar'; import GeminiScrollbar from 'react-gemini-scrollbar';
import RoomViewStore from '../../../stores/RoomViewStore'; import RoomViewStore from '../../../stores/RoomViewStore';
module.exports = withMatrixClient(React.createClass({ module.exports = withMatrixClient(React.createClass({
displayName: 'MemberInfo', displayName: 'MemberInfo',
@ -713,6 +712,10 @@ module.exports = withMatrixClient(React.createClass({
if (this.props.member.userId !== this.props.matrixClient.credentials.userId) { if (this.props.member.userId !== this.props.matrixClient.credentials.userId) {
const dmRoomMap = new DMRoomMap(this.props.matrixClient); const dmRoomMap = new DMRoomMap(this.props.matrixClient);
// dmRooms will not include dmRooms that we have been invited into but did not join.
// Because DMRoomMap runs off account_data[m.direct] which is only set on join of dm room.
// XXX: we potentially want DMs we have been invited to, to also show up here :L
// especially as logic below concerns specially if we haven't joined but have been invited
const dmRooms = dmRoomMap.getDMRoomsForUserId(this.props.member.userId); const dmRooms = dmRoomMap.getDMRoomsForUserId(this.props.member.userId);
const RoomTile = sdk.getComponent("rooms.RoomTile"); const RoomTile = sdk.getComponent("rooms.RoomTile");
@ -722,10 +725,15 @@ module.exports = withMatrixClient(React.createClass({
const room = this.props.matrixClient.getRoom(roomId); const room = this.props.matrixClient.getRoom(roomId);
if (room) { if (room) {
const me = room.getMember(this.props.matrixClient.credentials.userId); const me = room.getMember(this.props.matrixClient.credentials.userId);
const highlight = (
room.getUnreadNotificationCount('highlight') > 0 || // not a DM room if we have are not joined
me.membership === "invite" if (!me.membership || me.membership !== 'join') continue;
); // not a DM room if they are not joined
const them = this.props.member;
if (!them.membership || them.membership !== 'join') continue;
const highlight = room.getUnreadNotificationCount('highlight') > 0 || me.membership === 'invite';
tiles.push( tiles.push(
<RoomTile key={room.roomId} room={room} <RoomTile key={room.roomId} room={room}
collapsed={false} collapsed={false}

View file

@ -512,7 +512,8 @@ export default class MessageComposerInput extends React.Component {
// composer. For some reason the editor won't scroll automatically if we paste // composer. For some reason the editor won't scroll automatically if we paste
// blocks of text in or insert newlines. // blocks of text in or insert newlines.
if (textContent.slice(selection.start).indexOf("\n") === -1) { if (textContent.slice(selection.start).indexOf("\n") === -1) {
this.refs.editor.refs.editor.scrollTop = this.refs.editor.refs.editor.scrollHeight; let editorRoot = this.refs.editor.refs.editor.parentNode.parentNode;
editorRoot.scrollTop = editorRoot.scrollHeight;
} }
}); });
} }

View file

@ -660,7 +660,6 @@ module.exports = React.createClass({
editable={false} editable={false}
order="recent" order="recent"
isInvite={true} isInvite={true}
selectedRoom={self.props.selectedRoom}
incomingCall={self.state.incomingCall} incomingCall={self.state.incomingCall}
collapsed={self.props.collapsed} collapsed={self.props.collapsed}
searchFilter={self.props.searchFilter} searchFilter={self.props.searchFilter}
@ -674,7 +673,6 @@ module.exports = React.createClass({
emptyContent={this._getEmptyContent('m.favourite')} emptyContent={this._getEmptyContent('m.favourite')}
editable={true} editable={true}
order="manual" order="manual"
selectedRoom={self.props.selectedRoom}
incomingCall={self.state.incomingCall} incomingCall={self.state.incomingCall}
collapsed={self.props.collapsed} collapsed={self.props.collapsed}
searchFilter={self.props.searchFilter} searchFilter={self.props.searchFilter}
@ -688,7 +686,6 @@ module.exports = React.createClass({
headerItems={this._getHeaderItems('im.vector.fake.direct')} headerItems={this._getHeaderItems('im.vector.fake.direct')}
editable={true} editable={true}
order="recent" order="recent"
selectedRoom={self.props.selectedRoom}
incomingCall={self.state.incomingCall} incomingCall={self.state.incomingCall}
collapsed={self.props.collapsed} collapsed={self.props.collapsed}
alwaysShowHeader={true} alwaysShowHeader={true}
@ -702,7 +699,6 @@ module.exports = React.createClass({
emptyContent={this._getEmptyContent('im.vector.fake.recent')} emptyContent={this._getEmptyContent('im.vector.fake.recent')}
headerItems={this._getHeaderItems('im.vector.fake.recent')} headerItems={this._getHeaderItems('im.vector.fake.recent')}
order="recent" order="recent"
selectedRoom={self.props.selectedRoom}
incomingCall={self.state.incomingCall} incomingCall={self.state.incomingCall}
collapsed={self.props.collapsed} collapsed={self.props.collapsed}
searchFilter={self.props.searchFilter} searchFilter={self.props.searchFilter}
@ -718,7 +714,6 @@ module.exports = React.createClass({
emptyContent={this._getEmptyContent(tagName)} emptyContent={this._getEmptyContent(tagName)}
editable={true} editable={true}
order="manual" order="manual"
selectedRoom={self.props.selectedRoom}
incomingCall={self.state.incomingCall} incomingCall={self.state.incomingCall}
collapsed={self.props.collapsed} collapsed={self.props.collapsed}
searchFilter={self.props.searchFilter} searchFilter={self.props.searchFilter}
@ -733,7 +728,6 @@ module.exports = React.createClass({
emptyContent={this._getEmptyContent('m.lowpriority')} emptyContent={this._getEmptyContent('m.lowpriority')}
editable={true} editable={true}
order="recent" order="recent"
selectedRoom={self.props.selectedRoom}
incomingCall={self.state.incomingCall} incomingCall={self.state.incomingCall}
collapsed={self.props.collapsed} collapsed={self.props.collapsed}
searchFilter={self.props.searchFilter} searchFilter={self.props.searchFilter}
@ -744,7 +738,6 @@ module.exports = React.createClass({
label={_t('Historical')} label={_t('Historical')}
editable={false} editable={false}
order="recent" order="recent"
selectedRoom={self.props.selectedRoom}
collapsed={self.props.collapsed} collapsed={self.props.collapsed}
alwaysShowHeader={true} alwaysShowHeader={true}
startAsHidden={true} startAsHidden={true}