Add ability to send directly to a NetMail address

This commit is contained in:
Bryan Ashby 2018-01-13 09:06:50 -07:00
parent 9a00b3eb15
commit 84fd0ff6d2
3 changed files with 17 additions and 4 deletions

View file

@ -15,6 +15,7 @@ const stringFormat = require('./string_format.js');
const MessageAreaConfTempSwitcher = require('./mod_mixins.js').MessageAreaConfTempSwitcher;
const { isAnsi, cleanControlCodes, insert } = require('./string_util.js');
const Config = require('./config.js').config;
const { getAddressedToInfo } = require('./mail_util.js');
// deps
const async = require('async');
@ -432,6 +433,18 @@ exports.FullScreenEditorModule = exports.getModule = class FullScreenEditorModul
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
User.getUserIdAndNameByLookup(self.message.toUserName, (err, toUserId) => {
if(err) {