Fixed IRC federation's issues with the no-cache branch (#11906)
parent
a265af96f8
commit
cabcecab88
@ -1,15 +1,11 @@ |
|||||||
export default function handleOnCreateRoom(user, room) { |
export default function handleOnCreateRoom(user, room) { |
||||||
if (!room.usernames) { |
const users = RocketChat.models.Users.findByRoomId(room._id); |
||||||
return this.log(`Room ${ room.name } does not have a valid list of usernames`); |
|
||||||
} |
|
||||||
|
|
||||||
for (const username of room.usernames) { |
|
||||||
const user = RocketChat.models.Users.findOne({ username }); |
|
||||||
|
|
||||||
|
users.forEach((user) => { |
||||||
if (user.profile.irc.fromIRC) { |
if (user.profile.irc.fromIRC) { |
||||||
this.sendCommand('joinChannel', { room, user }); |
this.sendCommand('joinChannel', { room, user }); |
||||||
} else { |
} else { |
||||||
this.sendCommand('joinedChannel', { room, user }); |
this.sendCommand('joinedChannel', { room, user }); |
||||||
} |
} |
||||||
} |
}); |
||||||
} |
} |
||||||
|
Loading…
Reference in new issue