Fix error for duplicate room memberships
This commit is contained in:
parent
5d5c751de8
commit
4a54b63cc0
@ -64,9 +64,12 @@ export async function mapRoom(rcRoom: RcRoom): Promise<MatrixRoom> {
|
||||
|
||||
if (rcRoom.uids) {
|
||||
await Promise.all(
|
||||
rcRoom.uids.map(async (uid) => {
|
||||
[...new Set(rcRoom.uids)] // Deduplicate users
|
||||
.map(async (uid) => {
|
||||
await createMembership(rcRoom._id, uid)
|
||||
log.debug(`${uid} membership in direct chat ${rcRoom._id} created`)
|
||||
log.debug(
|
||||
`${uid} membership in direct chat ${rcRoom._id} created`
|
||||
)
|
||||
})
|
||||
)
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user