|
|
@ -255,7 +255,7 @@ Channel.writePrivateMessage = function (Env, args, _cb, Server, netfluxId) {
|
|
|
|
var allowed = HK.listAllowedUsers(metadata);
|
|
|
|
var allowed = HK.listAllowedUsers(metadata);
|
|
|
|
|
|
|
|
|
|
|
|
// Special broadcast channel
|
|
|
|
// Special broadcast channel
|
|
|
|
if (channelId === '00000000000000000000000000000000') {
|
|
|
|
if (channelId.length === HK.ADMIN_CHANNEL_LENGTH) {
|
|
|
|
allowed = Env.admins;
|
|
|
|
allowed = Env.admins;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -283,11 +283,18 @@ Channel.writePrivateMessage = function (Env, args, _cb, Server, netfluxId) {
|
|
|
|
|
|
|
|
|
|
|
|
// historyKeeper already knows how to handle metadata and message validation, so we just pass it off here
|
|
|
|
// historyKeeper already knows how to handle metadata and message validation, so we just pass it off here
|
|
|
|
// if the message isn't valid it won't be stored.
|
|
|
|
// if the message isn't valid it won't be stored.
|
|
|
|
Env.historyKeeper.channelMessage(Server, channelStruct, fullMessage);
|
|
|
|
Env.historyKeeper.channelMessage(Server, channelStruct, fullMessage, function (err) {
|
|
|
|
|
|
|
|
if (err) {
|
|
|
|
|
|
|
|
// Message not stored...
|
|
|
|
|
|
|
|
return void cb(err);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Broadcast the message
|
|
|
|
Server.getChannelUserList(channelId).forEach(function (userId) {
|
|
|
|
Server.getChannelUserList(channelId).forEach(function (userId) {
|
|
|
|
Server.send(userId, fullMessage);
|
|
|
|
Server.send(userId, fullMessage);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cb();
|
|
|
|
cb();
|
|
|
|
});
|
|
|
|
});
|
|
|
|