perf: no need to count on every call

This commit is contained in:
Barış Soner Uşaklı
2023-10-03 10:04:46 -04:00
parent 96e2e19424
commit 130815c725

View File

@@ -285,8 +285,7 @@ module.exports = function (Messaging) {
};
Messaging.isGroupChat = async function (roomId) {
const count = await Messaging.getUserCountInRoom(roomId);
return count > 2;
return (await Messaging.getRoomData(roomId)).groupChat;
};
async function updateUserCount(roomIds) {