Add {userName} and {userNameRaw} door launch/format options

This commit is contained in:
Bryan Ashby 2018-07-10 19:11:03 -06:00
parent ea3e0ac3ff
commit 5d91cfb7d0
2 changed files with 12 additions and 6 deletions

View File

@ -15,6 +15,8 @@ This document attempts to track **major** changes and additions in ENiGMA½. For
* The old concept of `autoScale` has been removed. See https://github.com/NuSkooler/enigma-bbs/issues/166
* Ability to delete from personal mailbox (finally!)
* Add ability to skip file and/or message areas during newscan. Set config.omitFileAreaTags and config.omitMessageAreaTags in new_scan configuration of your menu.hjson
* `{userName}` (sanatized) and `{userNameRaw}` as well as `{cwd}` have been added to param options when launching a door.
## 0.0.8-alpha
* [Mystic BBS style](http://wiki.mysticbbs.com/doku.php?id=displaycodes) extended pipe color codes. These allow for example, to set "iCE" background colors.

View File

@ -4,10 +4,12 @@
const stringFormat = require('./string_format.js');
const { Errors } = require('./enig_error.js');
// deps
const pty = require('node-pty');
const decode = require('iconv-lite').decode;
const createServer = require('net').createServer;
const paths = require('path');
const sanatizeFilename = require('sanitize-filename');
module.exports = class Door {
constructor(client) {
@ -64,6 +66,8 @@ module.exports = class Door {
node : exeInfo.node.toString(),
srvPort : this.sockServer ? this.sockServer.address().port.toString() : '-1',
userId : this.client.user.userId.toString(),
userName : sanatizeFilename(this.client.user.username),
userNameRaw : this.client.user.username,
cwd : cwd,
};