Built motion from commit da24aabd.|2.6.20
[motion2.git] / server / services / routing / server / applications / message.js
index a49e9bc..bd09b4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5fd=['../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','contact','channel','ChatWebsiteId','AccountId','upperFirst','InteractionId','interaction','Message','create','info','[%s][MESSAGE]\x20%s','body','catch','error','stringify','stop','lodash','routing','../../rpc/chatMessage'];(function(_0x105a8e,_0x15eaf2){var _0x484918=function(_0x3331f4){while(--_0x3331f4){_0x105a8e['push'](_0x105a8e['shift']());}};_0x484918(++_0x15eaf2);}(_0xe5fd,0x195));var _0xde5f=function(_0x101bcc,_0x3f9597){_0x101bcc=_0x101bcc-0x0;var _0x9ce532=_0xe5fd[_0x101bcc];return _0x9ce532;};'use strict';var _=require(_0xde5f('0x0'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0xde5f('0x1'));var rpc={'chatMessage':require(_0xde5f('0x2')),'openchannelMessage':require(_0xde5f('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xde5f('0x4')),'faxMessage':require(_0xde5f('0x5')),'whatsappMessage':require(_0xde5f('0x6'))};exports[_0xde5f('0x7')]=function(_0x1f37bb,_0x437dc2){return function(_0x5579d7){try{var _0x228405={'body':utils['getMustacheRender'](_0x437dc2[0x0],this),'ContactId':this[_0xde5f('0x8')]['id']};if(this[_0xde5f('0x9')]==='chat'){_0x228405[_0xde5f('0xa')]=this['account']['id'];}else{_0x228405[_['upperFirst'](this['channel'])+_0xde5f('0xb')]=this['account']['id'];}_0x228405[_[_0xde5f('0xc')](this[_0xde5f('0x9')])+_0xde5f('0xd')]=this[_0xde5f('0xe')]['id'];if(rpc[this[_0xde5f('0x9')]+_0xde5f('0xf')]){return rpc[this[_0xde5f('0x9')]+'Message'][_0xde5f('0x10')](_0x228405)['then'](function(_0x596509){logger[_0xde5f('0x11')](_0xde5f('0x12'),_0x1f37bb,_0x228405[_0xde5f('0x13')]);_0x5579d7['next']();})[_0xde5f('0x14')](function(_0x2e09ed){logger[_0xde5f('0x15')](_0xde5f('0x12'),_0x1f37bb,JSON[_0xde5f('0x16')](_0x2e09ed));_0x5579d7['stop']();});}}catch(_0x1b6799){logger['error'](_0xde5f('0x12'),_0x1f37bb,JSON[_0xde5f('0x16')](_0x1b6799));_0x5579d7[_0xde5f('0x17')]();}};};
\ 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