Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2077 from matrix-org/bwindels/fix-dm-error-on-lef…
Browse files Browse the repository at this point in the history
…t-room

FIX: Don't error on rooms the user has left already
  • Loading branch information
dbkr authored Jul 23, 2018
2 parents c1891aa + 3992e99 commit d242935
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/RoomInvite.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,11 @@ function _showAnyInviteErrors(addrs, room) {
function _getDirectMessageRooms(addr) {
const dmRoomMap = new DMRoomMap(MatrixClientPeg.get());
const dmRooms = dmRoomMap.getDMRoomsForUserId(addr);
const rooms = [];
dmRooms.forEach((dmRoom) => {
const rooms = dmRooms.filter((dmRoom) => {
const room = MatrixClientPeg.get().getRoom(dmRoom);
if (room) {
const me = room.getMember(MatrixClientPeg.get().credentials.userId);
if (me.membership == 'join') {
rooms.push(room);
}
return me && me.membership == 'join';
}
});
return rooms;
Expand Down

0 comments on commit d242935

Please sign in to comment.