don't try to set DM data for guests
This commit is contained in:
parent
88d92d1b61
commit
e1bd97d509
2 changed files with 8 additions and 1 deletions
|
@ -88,6 +88,10 @@ export function looksLikeDirectMessageRoom(room, me) {
|
||||||
* @returns {object} A promise
|
* @returns {object} A promise
|
||||||
*/
|
*/
|
||||||
export function setDMRoom(roomId, userId) {
|
export function setDMRoom(roomId, userId) {
|
||||||
|
if (MatrixClientPeg.get().isGuest()) {
|
||||||
|
return q();
|
||||||
|
}
|
||||||
|
|
||||||
const mDirectEvent = MatrixClientPeg.get().getAccountData('m.direct');
|
const mDirectEvent = MatrixClientPeg.get().getAccountData('m.direct');
|
||||||
let dmRoomMap = {};
|
let dmRoomMap = {};
|
||||||
|
|
||||||
|
|
|
@ -261,7 +261,10 @@ module.exports = React.createClass({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (s.lists["im.vector.fake.direct"].length == 0 && MatrixClientPeg.get().getAccountData('m.direct') === undefined) {
|
if (s.lists["im.vector.fake.direct"].length == 0 &&
|
||||||
|
MatrixClientPeg.get().getAccountData('m.direct') === undefined &&
|
||||||
|
!MatrixClientPeg.get().isGuest())
|
||||||
|
{
|
||||||
// scan through the 'recents' list for any rooms which look like DM rooms
|
// scan through the 'recents' list for any rooms which look like DM rooms
|
||||||
// and make them DM rooms
|
// and make them DM rooms
|
||||||
const oldRecents = s.lists["im.vector.fake.recent"];
|
const oldRecents = s.lists["im.vector.fake.recent"];
|
||||||
|
|
Loading…
Reference in a new issue