fix: add missing error message

This commit is contained in:
yflory 2026-03-12 11:15:37 +01:00
parent 2a3ab9056f
commit f0bfbd8d3b

View File

@ -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');