Add ability to send directly to a NetMail address
This commit is contained in:
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 { 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) {
|
||||
|
||||
Reference in New Issue
Block a user