From 839ab8fc91930044027b51ae1b899030c40cfb7b Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Fri, 20 Nov 2015 17:49:37 -0700 Subject: [PATCH] * Leaving feedback to Sysop #20 * Cache sysop info after first user created * ACS check preventing sysop from sending feedback to themselves @ apply --- core/message.js | 2 ++ mods/apply.js | 9 +++++++++ mods/menu.hjson | 13 +++++++++++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/core/message.js b/core/message.js index e81d6a84..6f67ba9e 100644 --- a/core/message.js +++ b/core/message.js @@ -85,6 +85,8 @@ Message.WellKnownAreaNames = { Private : 'private_mail' }; +// :TODO: This doesn't seem like a good way to go -- perhaps only for local/user2user, or just use +// a system similar to the "last read" for general areas Message.Status = { New : 0, Read : 1, diff --git a/mods/apply.js b/mods/apply.js index 5c3d38b3..cf83f58f 100644 --- a/mods/apply.js +++ b/mods/apply.js @@ -132,6 +132,15 @@ function submitApplication(callingMenu, formData, extraArgs) { } else { Log.info( { username : formData.value.username, userId : newUser.userId }, 'New user created'); + // Cache SysOp information now + // :TODO: Similar to bbs.js. DRY + if(newUser.isSysOp()) { + Config.general.sysOp = { + username : formData.value.username, + properties : newUser.properties, + }; + } + if(user.User.AccountStatus.inactive === client.user.properties.account_status) { callingMenu.gotoMenu(extraArgs.inactive); } else { diff --git a/mods/menu.hjson b/mods/menu.hjson index d9c03af3..3f855c95 100644 --- a/mods/menu.hjson +++ b/mods/menu.hjson @@ -123,7 +123,17 @@ */ newUserApplication: { art: NUA - next: newUserFeedbackToSysOpPreamble + next: [ + { + // Initial SysOp does not send feedback to themselves + acs: ID1 + next: fullLoginSequenceLoginArt + } + { + // ...everyone else does + next: newUserFeedbackToSysOpPreamble + } + ] form: { 0: { mci: { @@ -309,7 +319,6 @@ next: fullLoginSequenceLoginArt } { - // acs: !AS2 next: newUserInactiveDone } ]