semi-functional allow-list implementation in historyKeeper
This commit is contained in:
16
lib/api.js
16
lib/api.js
@@ -14,21 +14,7 @@ module.exports.create = function (config) {
|
||||
.on('channelClose', historyKeeper.channelClose)
|
||||
.on('channelMessage', historyKeeper.channelMessage)
|
||||
.on('channelOpen', historyKeeper.channelOpen)
|
||||
.on('sessionClose', function (userId, reason) {
|
||||
if (['BAD_MESSAGE', 'SOCKET_ERROR', 'SEND_MESSAGE_FAIL_2'].indexOf(reason) !== -1) {
|
||||
if (reason && reason.code === 'ECONNRESET') { return; }
|
||||
return void log.error('SESSION_CLOSE_WITH_ERROR', {
|
||||
userId: userId,
|
||||
reason: reason,
|
||||
});
|
||||
}
|
||||
|
||||
if (reason && reason === 'SOCKET_CLOSED') { return; }
|
||||
log.verbose('SESSION_CLOSE_ROUTINE', {
|
||||
userId: userId,
|
||||
reason: reason,
|
||||
});
|
||||
})
|
||||
.on('sessionClose', historyKeeper.sessionClose)
|
||||
.on('error', function (error, label, info) {
|
||||
if (!error) { return; }
|
||||
/* labels:
|
||||
|
||||
Reference in New Issue
Block a user