mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
use same code to add room to identity in migration as in device tracker
This commit is contained in:
parent
a437332482
commit
0d6ae19d99
@ -123,17 +123,9 @@ export class DeviceTracker {
|
|||||||
async _writeMember(member, txn) {
|
async _writeMember(member, txn) {
|
||||||
const {userIdentities} = txn;
|
const {userIdentities} = txn;
|
||||||
const identity = await userIdentities.get(member.userId);
|
const identity = await userIdentities.get(member.userId);
|
||||||
if (!identity) {
|
const updatedIdentity = addRoomToIdentity(identity, member.userId, member.roomId);
|
||||||
userIdentities.set({
|
if (updatedIdentity) {
|
||||||
userId: member.userId,
|
userIdentities.set(updatedIdentity);
|
||||||
roomIds: [member.roomId],
|
|
||||||
deviceTrackingStatus: TRACKING_STATUS_OUTDATED,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
if (!identity.roomIds.includes(member.roomId)) {
|
|
||||||
identity.roomIds.push(member.roomId);
|
|
||||||
userIdentities.set(identity);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user