|
|
|
@ -116,16 +116,22 @@ module.exports.create = function (config, cb) {
|
|
|
|
|
channelOpen: function (Server, channelName, userId, wait) {
|
|
|
|
|
Env.channel_cache[channelName] = Env.channel_cache[channelName] || {};
|
|
|
|
|
|
|
|
|
|
var next = wait();
|
|
|
|
|
var cb = function (err, info) {
|
|
|
|
|
next(err, info, function () {
|
|
|
|
|
var sendHKJoinMessage = function () {
|
|
|
|
|
Server.send(userId, [
|
|
|
|
|
0,
|
|
|
|
|
Env.id,
|
|
|
|
|
'JOIN',
|
|
|
|
|
channelName
|
|
|
|
|
]);
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// a little backwards compatibility in case you don't have the latest server
|
|
|
|
|
// allow lists won't work unless you update, though
|
|
|
|
|
if (typeof(wait) !== 'function') { return void sendHKJoinMessage(); }
|
|
|
|
|
|
|
|
|
|
var next = wait();
|
|
|
|
|
var cb = function (err, info) {
|
|
|
|
|
next(err, info, sendHKJoinMessage);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// only conventional channels can be restricted
|
|
|
|
|