diff --git a/core/system_events.js b/core/system_events.js index 706ad8a5..133561cb 100644 --- a/core/system_events.js +++ b/core/system_events.js @@ -2,13 +2,19 @@ 'use strict'; module.exports = { - ClientConnected : 'codes.l33t.enigma.system.connected', // { client, connectionCount } - ClientDisconnected : 'codes.l33t.enigma.system.disconnected', // { client, connectionCount } + ClientConnected : 'codes.l33t.enigma.system.connected', // { client, connectionCount } + ClientDisconnected : 'codes.l33t.enigma.system.disconnected', // { client, connectionCount } TermDetected : 'codes.l33t.enigma.system.term_detected', // { client } // User - includes { user, ...} + NewUser : 'codes.l33t.enigma.system.new_user', UserLogin : 'codes.l33t.enigma.system.user_login', UserLogoff : 'codes.l33t.enigma.system.user_logoff', UserUpload : 'codes.l33t.enigma.system.user_upload', // {..., files[ fileEntry, ...] } UserDownload : 'codes.l33t.enigma.system.user_download', // {..., files[ fileEntry, ...] } -}; \ No newline at end of file + + // NYI below here: + UserPostMessage : 'codes.l33t.enigma.system.user_post_msg', + UserSendMail : 'codes.l33t.enigma.system.user_send_mail', + UserSendRunDoor : 'codes.l33t.enigma.system.user_run_door', +}; diff --git a/core/user.js b/core/user.js index 16f84e8b..7f50223d 100644 --- a/core/user.js +++ b/core/user.js @@ -5,6 +5,7 @@ const userDb = require('./database.js').dbs.user; const Config = require('./config.js').config; const userGroup = require('./user_group.js'); const Errors = require('./enig_error.js').Errors; +const Events = require('./events.js'); // deps const crypto = require('crypto'); @@ -240,6 +241,10 @@ module.exports = class User { self.persistWithTransaction(trans, err => { return callback(err, trans); }); + }, + function sendEvent(trans, callback) { + Events.emit(Events.getSystemEvents().NewUser, { user : self }); + return callback(null, trans); } ], (err, trans) => {