mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-06 20:55:30 +02:00
Add ability to send directly to a NetMail address
This commit is contained in:
parent
9a00b3eb15
commit
84fd0ff6d2
3 changed files with 17 additions and 4 deletions
13
core/fse.js
13
core/fse.js
|
@ -15,6 +15,7 @@ const stringFormat = require('./string_format.js');
|
||||||
const MessageAreaConfTempSwitcher = require('./mod_mixins.js').MessageAreaConfTempSwitcher;
|
const MessageAreaConfTempSwitcher = require('./mod_mixins.js').MessageAreaConfTempSwitcher;
|
||||||
const { isAnsi, cleanControlCodes, insert } = require('./string_util.js');
|
const { isAnsi, cleanControlCodes, insert } = require('./string_util.js');
|
||||||
const Config = require('./config.js').config;
|
const Config = require('./config.js').config;
|
||||||
|
const { getAddressedToInfo } = require('./mail_util.js');
|
||||||
|
|
||||||
// deps
|
// deps
|
||||||
const async = require('async');
|
const async = require('async');
|
||||||
|
@ -432,6 +433,18 @@ exports.FullScreenEditorModule = exports.getModule = class FullScreenEditorModul
|
||||||
return callback(null);
|
return callback(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Detect if the user is attempting to send to a remote mail type that we support
|
||||||
|
//
|
||||||
|
// :TODO: how to plug in support without tying to various types here? isSupportedExteranlType() or such
|
||||||
|
const addressedToInfo = getAddressedToInfo(self.message.toUserName);
|
||||||
|
if(addressedToInfo.name && Message.AddressFlavor.FTN === addressedToInfo.flavor) {
|
||||||
|
self.message.setRemoteToUser(addressedToInfo.remote);
|
||||||
|
self.message.setExternalFlavor(addressedToInfo.flavor);
|
||||||
|
self.message.toUserName = addressedToInfo.name;
|
||||||
|
return callback(null);
|
||||||
|
}
|
||||||
|
|
||||||
// we need to look it up
|
// we need to look it up
|
||||||
User.getUserIdAndNameByLookup(self.message.toUserName, (err, toUserId) => {
|
User.getUserIdAndNameByLookup(self.message.toUserName, (err, toUserId) => {
|
||||||
if(err) {
|
if(err) {
|
||||||
|
|
|
@ -92,7 +92,7 @@ function areaFix() {
|
||||||
meta : {
|
meta : {
|
||||||
System : {
|
System : {
|
||||||
[ Message.SystemMetaNames.RemoteToUser ] : ftnAddr.toString(), // where to send it
|
[ Message.SystemMetaNames.RemoteToUser ] : ftnAddr.toString(), // where to send it
|
||||||
[ Message.SystemMetaNames.ExternalFlavor ] : Message.ExternalFlavors.FTN, // on FTN-style network
|
[ Message.SystemMetaNames.ExternalFlavor ] : Message.AddressFlavor.FTN, // on FTN-style network
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1170,7 +1170,7 @@ function FTNMessageScanTossModule() {
|
||||||
message.areaTag = config.localAreaTag;
|
message.areaTag = config.localAreaTag;
|
||||||
|
|
||||||
// indicate this was imported from FTN
|
// indicate this was imported from FTN
|
||||||
message.meta.System[Message.SystemMetaNames.ExternalFlavor] = Message.ExternalFlavors.FTN;
|
message.meta.System[Message.SystemMetaNames.ExternalFlavor] = Message.AddressFlavor.FTN;
|
||||||
|
|
||||||
//
|
//
|
||||||
// If we *allow* dupes (disabled by default), then just generate
|
// If we *allow* dupes (disabled by default), then just generate
|
||||||
|
@ -1968,7 +1968,7 @@ function FTNMessageScanTossModule() {
|
||||||
WHERE message_id = m.message_id
|
WHERE message_id = m.message_id
|
||||||
AND meta_category = 'System'
|
AND meta_category = 'System'
|
||||||
AND meta_name = '${Message.SystemMetaNames.ExternalFlavor}'
|
AND meta_name = '${Message.SystemMetaNames.ExternalFlavor}'
|
||||||
AND meta_value = '${Message.ExternalFlavors.FTN}'
|
AND meta_value = '${Message.AddressFlavor.FTN}'
|
||||||
) = 1
|
) = 1
|
||||||
ORDER BY message_id;
|
ORDER BY message_id;
|
||||||
`;
|
`;
|
||||||
|
@ -2005,7 +2005,7 @@ function FTNMessageScanTossModule() {
|
||||||
this.isNetMailMessage = function(message) {
|
this.isNetMailMessage = function(message) {
|
||||||
return message.isPrivate() &&
|
return message.isPrivate() &&
|
||||||
null === _.get(message, 'meta.System.LocalToUserID', null) &&
|
null === _.get(message, 'meta.System.LocalToUserID', null) &&
|
||||||
Message.ExternalFlavors.FTN === _.get(message, 'meta.System.external_flavor', null)
|
Message.AddressFlavor.FTN === _.get(message, 'meta.System.external_flavor', null)
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue