mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-02 18:41:19 +01:00
@@ -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]))
|
||||
),
|
||||
]),
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user