fix: #14032, fix regression in room creation

add test
This commit is contained in:
Barış Soner Uşaklı
2026-03-01 15:45:32 -05:00
parent 08e94e35d7
commit 2d49da7889
2 changed files with 15 additions and 1 deletions

View File

@@ -110,7 +110,7 @@ module.exports = function (Messaging) {
[`chat:room:${roomId}:uids:online`, now, uid],
...(
isPublic ?
[`chat:room:${roomId}:owners`, now, uid] :
[[`chat:room:${roomId}:owners`, now, uid]] :
[uid].concat(data.uids).map(uid => ([`chat:room:${roomId}:owners`, now, uid]))
),
]),

View File

@@ -599,6 +599,20 @@ describe('Messaging Library', () => {
const { roomId } = await api.users.getPrivateRoomId({ uid: mocks.users.foo.uid }, { uid: mocks.users.herp.uid });
assert(roomId);
});
it('should create a public chat room', async () => {
const data = await api.chats.create({
uid: mocks.users.foo.uid,
session: {},
}, {
name: 'public room',
type: 'public',
uids: [],
groups: ['registered-users'],
});
assert(data.roomId);
assert.strictEqual(data.public, true);
});
});
describe('toMid', () => {