Built motion from commit da24aabd.|2.6.20
[motion2.git] / server / services / routing / server / applications / message.js
index 22c8bc2..bd09b4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ccc=['account','upperFirst','channel','AccountId','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','contact','chat','ChatWebsiteId'];(function(_0x5ec21d,_0x5d0772){var _0x43bde8=function(_0x1bfc7c){while(--_0x1bfc7c){_0x5ec21d['push'](_0x5ec21d['shift']());}};_0x43bde8(++_0x5d0772);}(_0x6ccc,0x197));var _0xc6cc=function(_0x3d6d80,_0x1689b7){_0x3d6d80=_0x3d6d80-0x0;var _0x30712a=_0x6ccc[_0x3d6d80];return _0x30712a;};'use strict';var _=require(_0xc6cc('0x0'));var utils=require(_0xc6cc('0x1'));var logger=require('../../../../config/logger')(_0xc6cc('0x2'));var rpc={'chatMessage':require(_0xc6cc('0x3')),'openchannelMessage':require(_0xc6cc('0x4')),'mailMessage':require(_0xc6cc('0x5')),'smsMessage':require(_0xc6cc('0x6')),'faxMessage':require(_0xc6cc('0x7')),'whatsappMessage':require(_0xc6cc('0x8'))};exports['consequence']=function(_0xaf2e1e,_0x343685){return function(_0x254a3a){try{var _0x15013d={'body':utils[_0xc6cc('0x9')](_0x343685[0x0],this),'ContactId':this[_0xc6cc('0xa')]['id']};if(this['channel']===_0xc6cc('0xb')){_0x15013d[_0xc6cc('0xc')]=this[_0xc6cc('0xd')]['id'];}else{_0x15013d[_[_0xc6cc('0xe')](this[_0xc6cc('0xf')])+_0xc6cc('0x10')]=this[_0xc6cc('0xd')]['id'];}_0x15013d[_[_0xc6cc('0xe')](this[_0xc6cc('0xf')])+_0xc6cc('0x11')]=this[_0xc6cc('0x12')]['id'];if(rpc[this[_0xc6cc('0xf')]+_0xc6cc('0x13')]){return rpc[this['channel']+_0xc6cc('0x13')][_0xc6cc('0x14')](_0x15013d)[_0xc6cc('0x15')](function(_0x111721){logger[_0xc6cc('0x16')](_0xc6cc('0x17'),_0xaf2e1e,_0x15013d[_0xc6cc('0x18')]);_0x254a3a[_0xc6cc('0x19')]();})[_0xc6cc('0x1a')](function(_0x3ede18){logger[_0xc6cc('0x1b')](_0xc6cc('0x17'),_0xaf2e1e,JSON[_0xc6cc('0x1c')](_0x3ede18));_0x254a3a[_0xc6cc('0x1d')]();});}}catch(_0xf56c7e){logger[_0xc6cc('0x1b')](_0xc6cc('0x17'),_0xaf2e1e,JSON[_0xc6cc('0x1c')](_0xf56c7e));_0x254a3a[_0xc6cc('0x1d')]();}};};
\ No newline at end of file
+var _0xe6b6=['../../rpc/whatsappMessage','consequence','contact','ChatWebsiteId','account','upperFirst','channel','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','catch','stringify','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/smsMessage'];(function(_0x20344b,_0x41d19f){var _0x1a47ec=function(_0xd43c49){while(--_0xd43c49){_0x20344b['push'](_0x20344b['shift']());}};_0x1a47ec(++_0x41d19f);}(_0xe6b6,0x150));var _0x6e6b=function(_0x39389d,_0x93fe6){_0x39389d=_0x39389d-0x0;var _0xab3c25=_0xe6b6[_0x39389d];return _0xab3c25;};'use strict';var _=require('lodash');var utils=require(_0x6e6b('0x0'));var logger=require(_0x6e6b('0x1'))('routing');var rpc={'chatMessage':require(_0x6e6b('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x6e6b('0x3')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x6e6b('0x4'))};exports[_0x6e6b('0x5')]=function(_0x3e591e,_0x5c0fdc){return function(_0x528f42){try{var _0x1bb636={'body':utils['getMustacheRender'](_0x5c0fdc[0x0],this),'ContactId':this[_0x6e6b('0x6')]['id']};if(this['channel']==='chat'){_0x1bb636[_0x6e6b('0x7')]=this[_0x6e6b('0x8')]['id'];}else{_0x1bb636[_[_0x6e6b('0x9')](this[_0x6e6b('0xa')])+'AccountId']=this[_0x6e6b('0x8')]['id'];}_0x1bb636[_[_0x6e6b('0x9')](this['channel'])+'InteractionId']=this[_0x6e6b('0xb')]['id'];if(rpc[this[_0x6e6b('0xa')]+'Message']){return rpc[this[_0x6e6b('0xa')]+_0x6e6b('0xc')][_0x6e6b('0xd')](_0x1bb636)[_0x6e6b('0xe')](function(_0xd37e20){logger[_0x6e6b('0xf')](_0x6e6b('0x10'),_0x3e591e,_0x1bb636[_0x6e6b('0x11')]);_0x528f42['next']();})[_0x6e6b('0x12')](function(_0x3921cd){logger['error']('[%s][MESSAGE]\x20%s',_0x3e591e,JSON['stringify'](_0x3921cd));_0x528f42['stop']();});}}catch(_0x3e9020){logger['error'](_0x6e6b('0x10'),_0x3e591e,JSON[_0x6e6b('0x13')](_0x3e9020));_0x528f42['stop']();}};};
\ No newline at end of file