mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
fix: add missing error message
This commit is contained in:
parent
2a3ab9056f
commit
f0bfbd8d3b
@ -1028,6 +1028,17 @@ HK.onChannelMessage = function (Env, Server, channel, msgStruct, cb) {
|
||||
if (!_metadata) { return; }
|
||||
metadata = _metadata;
|
||||
|
||||
if (metadata?.restricted) {
|
||||
const userId = msgStruct[1];
|
||||
// If userId is defined (not a private message) and the user
|
||||
// is not a member of this restricted channel, prevent them
|
||||
// from broadcasting to the pad until they have joined it
|
||||
if (userId && !Server.channelContainsUser(channel.id, userId)) {
|
||||
cb('EFORBIDDEN');
|
||||
return void w.abort();
|
||||
}
|
||||
}
|
||||
|
||||
// don't write messages to expired channels
|
||||
if (checkExpired(Env, Server, channel)) {
|
||||
cb('EEXPIRED');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user