add s.onUserLog event handler
parent
1c0e9a07bc
commit
9969f33d57
|
|
@ -5,6 +5,11 @@ module.exports = function(s,config){
|
|||
s.onSocketAuthenticationExtensions.push(callback)
|
||||
}
|
||||
//
|
||||
s.onUserLogExtensions = []
|
||||
s.onUserLog = function(callback){
|
||||
s.onUserLogExtensions.push(callback)
|
||||
}
|
||||
//
|
||||
s.loadGroupExtensions = []
|
||||
s.loadGroupExtender = function(callback){
|
||||
s.loadGroupExtensions.push(callback)
|
||||
|
|
|
|||
12
libs/user.js
12
libs/user.js
|
|
@ -105,7 +105,17 @@ module.exports = function(s,config,lang){
|
|||
}
|
||||
})
|
||||
}
|
||||
s.tx({f:'log',ke:e.ke,mid:e.mid,log:x,time:s.timeObject()},'GRPLOG_'+e.ke);
|
||||
const logEvent = {
|
||||
f: 'log',
|
||||
ke: e.ke,
|
||||
mid: e.mid,
|
||||
log: x,
|
||||
time: s.timeObject()
|
||||
}
|
||||
s.tx(logEvent,'GRPLOG_'+e.ke);
|
||||
s.onUserLogExtensions.forEach(function(extender){
|
||||
extender(logEvent)
|
||||
})
|
||||
}
|
||||
s.loadGroup = function(e){
|
||||
s.loadGroupExtensions.forEach(function(extender){
|
||||
|
|
|
|||
Loading…
Reference in New Issue