Built motion from commit b5413ace.|2.6.9
[motion2.git] / server / services / routing / server / applications / message.js
index 2c7559f..b89d1ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c1a=['Message','create','info','[%s][MESSAGE]\x20%s','body','next','catch','stringify','error','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','contact','channel','chat','ChatWebsiteId','account','InteractionId','interaction'];(function(_0x416410,_0x6a9e9a){var _0x4bc727=function(_0x104840){while(--_0x104840){_0x416410['push'](_0x416410['shift']());}};_0x4bc727(++_0x6a9e9a);}(_0x3c1a,0xda));var _0xa3c1=function(_0x29ae80,_0x3579f1){_0x29ae80=_0x29ae80-0x0;var _0x5d6d71=_0x3c1a[_0x29ae80];return _0x5d6d71;};'use strict';var _=require(_0xa3c1('0x0'));var utils=require(_0xa3c1('0x1'));var logger=require(_0xa3c1('0x2'))(_0xa3c1('0x3'));var rpc={'chatMessage':require(_0xa3c1('0x4')),'openchannelMessage':require(_0xa3c1('0x5')),'mailMessage':require(_0xa3c1('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xa3c1('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xa3c1('0x8')]=function(_0x8e2873,_0x3f6cab){return function(_0x2da4d2){try{var _0x546253={'body':utils['getMustacheRender'](_0x3f6cab[0x0],this),'ContactId':this[_0xa3c1('0x9')]['id']};if(this[_0xa3c1('0xa')]===_0xa3c1('0xb')){_0x546253[_0xa3c1('0xc')]=this[_0xa3c1('0xd')]['id'];}else{_0x546253[_['upperFirst'](this[_0xa3c1('0xa')])+'AccountId']=this['account']['id'];}_0x546253[_['upperFirst'](this['channel'])+_0xa3c1('0xe')]=this[_0xa3c1('0xf')]['id'];if(rpc[this[_0xa3c1('0xa')]+_0xa3c1('0x10')]){return rpc[this[_0xa3c1('0xa')]+_0xa3c1('0x10')][_0xa3c1('0x11')](_0x546253)['then'](function(_0x2d2499){logger[_0xa3c1('0x12')](_0xa3c1('0x13'),_0x8e2873,_0x546253[_0xa3c1('0x14')]);_0x2da4d2[_0xa3c1('0x15')]();})[_0xa3c1('0x16')](function(_0x1d3837){logger['error'](_0xa3c1('0x13'),_0x8e2873,JSON[_0xa3c1('0x17')](_0x1d3837));_0x2da4d2['stop']();});}}catch(_0x261ac7){logger[_0xa3c1('0x18')]('[%s][MESSAGE]\x20%s',_0x8e2873,JSON['stringify'](_0x261ac7));_0x2da4d2[_0xa3c1('0x19')]();}};};
\ No newline at end of file
+var _0x01f6=['../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','stringify','stop','error'];(function(_0x269094,_0x4701b3){var _0x10344f=function(_0x180a69){while(--_0x180a69){_0x269094['push'](_0x269094['shift']());}};_0x10344f(++_0x4701b3);}(_0x01f6,0xea));var _0x601f=function(_0x2b07a1,_0x25c79a){_0x2b07a1=_0x2b07a1-0x0;var _0x4bb96b=_0x01f6[_0x2b07a1];return _0x4bb96b;};'use strict';var _=require('lodash');var utils=require('./utils');var logger=require(_0x601f('0x0'))(_0x601f('0x1'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x601f('0x2')),'mailMessage':require(_0x601f('0x3')),'smsMessage':require(_0x601f('0x4')),'faxMessage':require(_0x601f('0x5')),'whatsappMessage':require(_0x601f('0x6'))};exports['consequence']=function(_0x8f542,_0x5724a2){return function(_0x824bec){try{var _0x4822c4={'body':utils[_0x601f('0x7')](_0x5724a2[0x0],this),'ContactId':this['contact']['id']};if(this[_0x601f('0x8')]===_0x601f('0x9')){_0x4822c4[_0x601f('0xa')]=this[_0x601f('0xb')]['id'];}else{_0x4822c4[_[_0x601f('0xc')](this[_0x601f('0x8')])+'AccountId']=this['account']['id'];}_0x4822c4[_['upperFirst'](this['channel'])+_0x601f('0xd')]=this[_0x601f('0xe')]['id'];if(rpc[this['channel']+_0x601f('0xf')]){return rpc[this[_0x601f('0x8')]+_0x601f('0xf')][_0x601f('0x10')](_0x4822c4)[_0x601f('0x11')](function(_0x5ef0da){logger[_0x601f('0x12')](_0x601f('0x13'),_0x8f542,_0x4822c4[_0x601f('0x14')]);_0x824bec[_0x601f('0x15')]();})[_0x601f('0x16')](function(_0x14770b){logger['error']('[%s][MESSAGE]\x20%s',_0x8f542,JSON[_0x601f('0x17')](_0x14770b));_0x824bec[_0x601f('0x18')]();});}}catch(_0x3e008e){logger[_0x601f('0x19')](_0x601f('0x13'),_0x8f542,JSON[_0x601f('0x17')](_0x3e008e));_0x824bec[_0x601f('0x18')]();}};};
\ No newline at end of file