Merge pull request #761 from matrix-org/luke/fix-people-section2

Fix people section DropTarget and refactor Rooms
This commit is contained in:
Luke Barnard 2017-03-27 15:52:28 +02:00 committed by GitHub
commit 7eb3a776dc
2 changed files with 16 additions and 0 deletions

View File

@ -79,6 +79,20 @@ export function looksLikeDirectMessageRoom(room, me) {
return false; return false;
} }
export function guessAndSetDMRoom(room, isDirect) {
let newTarget;
if (isDirect) {
const guessedTarget = guessDMRoomTarget(
room, room.getMember(MatrixClientPeg.get().credentials.userId),
);
newTarget = guessedTarget.userId;
} else {
newTarget = null;
}
return setDMRoom(room.roomId, newTarget);
}
/** /**
* Marks or unmarks the given room as being as a DM room. * Marks or unmarks the given room as being as a DM room.
* @param {string} roomId The ID of the room to modify * @param {string} roomId The ID of the room to modify

View File

@ -485,6 +485,8 @@ module.exports = React.createClass({
<RoomSubList list={ self.state.lists['im.vector.fake.direct'] } <RoomSubList list={ self.state.lists['im.vector.fake.direct'] }
label="People" label="People"
tagName="im.vector.fake.direct"
verb="tag direct chat"
editable={ true } editable={ true }
order="recent" order="recent"
selectedRoom={ self.props.selectedRoom } selectedRoom={ self.props.selectedRoom }