1- module . exports = function ( hostileService , eventService , memberService , async , eveapi , headerParser , errorResponse , successResponse , _ ) {
1+ module . exports = function ( hostileService , eventService , memberService , async , eveapi , headerParser , settings , errorResponse , successResponse , _ ) {
22
33 var pub = { } ;
44
@@ -8,6 +8,7 @@ module.exports = function (hostileService, eventService, memberService, async, e
88 || ! status . systemName
99 || ! status . reporterId
1010 || ! status . reporterName
11+ || ! status . text
1112 || ! status . pilots
1213 || ! typeof ( status . pilots ) === 'object' ) {
1314 return false ;
@@ -19,6 +20,7 @@ module.exports = function (hostileService, eventService, memberService, async, e
1920 pub . run = function ( req , res ) {
2021 var scanData = req . body . scanData ;
2122
23+ if ( scanData . pilots === undefined ) scanData . pilots = [ ] ;
2224 if ( ! checkStatusDataIntegrity ( scanData ) ) {
2325 return errorResponse . respond ( res , 'status' , 'Invalid status data.' ) ;
2426 }
@@ -36,18 +38,22 @@ module.exports = function (hostileService, eventService, memberService, async, e
3638 var hostiles = [ ] ;
3739 _ . forEach ( results . characters , function ( character ) {
3840
39- // do a quick check here to see if corporationId or allianceId is in the whitelist
41+ if ( _ . contains ( settings . whitelist . alliances , parseInt ( character . allianceID ) ) ) return ;
42+ if ( _ . contains ( settings . whitelist . corporations , parseInt ( character . corporationID ) ) ) return ;
43+
4044 hostiles . push ( { id : character . characterID
4145 , name : character . characterName
42- , corporationId : character . corporationID
46+ , corporationID : character . corporationID
4347 , corporationName : character . corporationName
44- , allianceId : character . allianceID
48+ , allianceID : character . allianceID
4549 , allianceName : character . allianceName
4650 , shipTypeId : null
47- , shipType : 'Non-visual'
51+ , shipType : null
4852 , shipName : null
4953 } ) ;
54+
5055 } ) ;
56+ console . log ( hostiles )
5157 callback ( null , hostiles ) ;
5258 }
5359 ] , function ( error , hostiles ) {
0 commit comments