Add send node msg event

This commit is contained in:
Bryan Ashby 2018-12-01 17:00:07 -07:00
parent eec06e7004
commit 36d55a409e
5 changed files with 9 additions and 4 deletions

View File

@ -149,7 +149,7 @@ function initializeModules(cb) {
return nextModule(null); return nextModule(null);
} }
} catch(e) { } catch(e) {
Log.warn( { error : e }, 'Exception during "moduleInitialize"'); Log.warn( { error : e.message, fullModulePath }, 'Exception during "moduleInitialize"');
return nextModule(null); return nextModule(null);
} }
}, },

View File

@ -12,6 +12,7 @@ const { getThemeArt } = require('./theme.js');
const { pipeToAnsi } = require('./color_codes.js'); const { pipeToAnsi } = require('./color_codes.js');
const stringFormat = require('./string_format.js'); const stringFormat = require('./string_format.js');
const { renderStringLength } = require('./string_util.js'); const { renderStringLength } = require('./string_util.js');
const Events = require('./events.js');
// deps // deps
const series = require('async/series'); const series = require('async/series');
@ -37,7 +38,7 @@ const MciViewIds = {
customRangeStart : 10, customRangeStart : 10,
} }
} };
exports.getModule = class NodeMessageModule extends MenuModule { exports.getModule = class NodeMessageModule extends MenuModule {
constructor(options) { constructor(options) {
@ -64,6 +65,8 @@ exports.getModule = class NodeMessageModule extends MenuModule {
} }
} }
Events.emit(Events.getSystemEvents().UserSendNodeMsg, { user : this.client.user } );
return this.prevMenu(cb); return this.prevMenu(cb);
}); });
}, },

View File

@ -355,7 +355,7 @@ class StatLog {
systemEvents.NewUser, systemEvents.NewUser,
systemEvents.UserUpload, systemEvents.UserDownload, systemEvents.UserUpload, systemEvents.UserDownload,
systemEvents.UserPostMessage, systemEvents.UserSendMail, systemEvents.UserPostMessage, systemEvents.UserSendMail,
systemEvents.UserRunDoor, systemEvents.UserRunDoor, systemEvents.UserSendNodeMsg,
]; ];
Events.addListenerMultipleEvents(interestedEvents, (eventName, event) => { Events.addListenerMultipleEvents(interestedEvents, (eventName, event) => {

View File

@ -20,4 +20,5 @@ module.exports = {
UserPostMessage : 'codes.l33t.enigma.system.user_post_msg', // { areaTag } UserPostMessage : 'codes.l33t.enigma.system.user_post_msg', // { areaTag }
UserSendMail : 'codes.l33t.enigma.system.user_send_mail', UserSendMail : 'codes.l33t.enigma.system.user_send_mail',
UserRunDoor : 'codes.l33t.enigma.system.user_run_door', UserRunDoor : 'codes.l33t.enigma.system.user_run_door',
UserSendNodeMsg : 'codes.l33t.enigma.system.user_send_node_msg',
}; };

View File

@ -20,6 +20,7 @@ Available `config` block entries:
* `userPostMsg` * `userPostMsg`
* `userSendMail` * `userSendMail`
* `userRunDoor` * `userRunDoor`
* `userSendNodeMsg`
* `actionIndicatorDefault`: Default indicator when an action is not set. Defaults to "-". * `actionIndicatorDefault`: Default indicator when an action is not set. Defaults to "-".
Remember that entries such as `actionIndicators` and `actionIndicatorDefault` may contain pipe color codes! Remember that entries such as `actionIndicators` and `actionIndicatorDefault` may contain pipe color codes!
@ -32,6 +33,6 @@ The following `itemFormat` object is provided to MCI 1 (ie: `%VM1`):
* `ts`: Timestamp in `dateTimeFormat` format. * `ts`: Timestamp in `dateTimeFormat` format.
* `location`: User's location. * `location`: User's location.
* `affiliation` or `affils`: Users affiliations. * `affiliation` or `affils`: Users affiliations.
* `actions`: A string built by concatenating action indicators for a users logged in session. For example, given a indincator of `userDownload` mapped to "D", the string may be "-D----". The format was made popular on Amiga style boards. * `actions`: A string built by concatenating action indicators for a users logged in session. For example, given a indicator of `userDownload` mapped to "D", the string may be "-D----". The format was made popular on Amiga style boards.