Allow wildcards such as "21:*" for node configuraiton keys
* Resolves TODO * Aligns with docs
This commit is contained in:
parent
a611870dbf
commit
3db5081698
|
@ -584,15 +584,6 @@ function FTNMessageScanTossModule() {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// :TODO: deprecate this in favor of getNodeConfigByAddress()
|
|
||||||
this.getNodeConfigKeyByAddress = function(uplink) {
|
|
||||||
const nodeKey = _.filter(Object.keys(this.moduleConfig.nodes), addr => {
|
|
||||||
return Address.fromString(addr).isPatternMatch(uplink);
|
|
||||||
})[0];
|
|
||||||
|
|
||||||
return nodeKey;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.exportNetMailMessagePacket = function(message, exportOpts, cb) {
|
this.exportNetMailMessagePacket = function(message, exportOpts, cb) {
|
||||||
//
|
//
|
||||||
// For NetMail, we always create a *single* packet per message.
|
// For NetMail, we always create a *single* packet per message.
|
||||||
|
@ -976,20 +967,19 @@ function FTNMessageScanTossModule() {
|
||||||
|
|
||||||
this.exportEchoMailMessagesToUplinks = function(messageUuids, areaConfig, cb) {
|
this.exportEchoMailMessagesToUplinks = function(messageUuids, areaConfig, cb) {
|
||||||
async.each(areaConfig.uplinks, (uplink, nextUplink) => {
|
async.each(areaConfig.uplinks, (uplink, nextUplink) => {
|
||||||
const nodeConfigKey = self.getNodeConfigKeyByAddress(uplink);
|
const nodeConfig = self.getNodeConfigByAddress(uplink);
|
||||||
if(!nodeConfigKey) {
|
if(!nodeConfig) {
|
||||||
return nextUplink();
|
return nextUplink();
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportOpts = {
|
const exportOpts = {
|
||||||
nodeConfig : self.moduleConfig.nodes[nodeConfigKey],
|
nodeConfig,
|
||||||
network : Config.messageNetworks.ftn.networks[areaConfig.network],
|
network : Config.messageNetworks.ftn.networks[areaConfig.network],
|
||||||
destAddress : Address.fromString(uplink),
|
destAddress : Address.fromString(uplink),
|
||||||
networkName : areaConfig.network,
|
networkName : areaConfig.network,
|
||||||
fileCase : self.moduleConfig.nodes[nodeConfigKey].fileCase || 'lower',
|
fileCase : nodeConfig.fileCase || 'lower',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
if(_.isString(exportOpts.network.localAddress)) {
|
if(_.isString(exportOpts.network.localAddress)) {
|
||||||
exportOpts.network.localAddress = Address.fromString(exportOpts.network.localAddress);
|
exportOpts.network.localAddress = Address.fromString(exportOpts.network.localAddress);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue