Built motion from commit da24aabd.|2.6.20
[motion2.git] / server / services / routing / server / applications / message.js
index f29fa1a..bd09b4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb21=['stringify','stop','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','chat','ChatWebsiteId','account','channel','AccountId','upperFirst','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','next','catch','error'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xdb21,0xcd));var _0x1db2=function(_0x214d54,_0x133c72){_0x214d54=_0x214d54-0x0;var _0x44ca46=_0xdb21[_0x214d54];return _0x44ca46;};'use strict';var _=require(_0x1db2('0x0'));var utils=require(_0x1db2('0x1'));var logger=require('../../../../config/logger')(_0x1db2('0x2'));var rpc={'chatMessage':require(_0x1db2('0x3')),'openchannelMessage':require(_0x1db2('0x4')),'mailMessage':require(_0x1db2('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x1db2('0x6')),'whatsappMessage':require(_0x1db2('0x7'))};exports[_0x1db2('0x8')]=function(_0x4732b6,_0x23784b){return function(_0x1f5184){try{var _0x2091b4={'body':utils[_0x1db2('0x9')](_0x23784b[0x0],this),'ContactId':this[_0x1db2('0xa')]['id']};if(this['channel']===_0x1db2('0xb')){_0x2091b4[_0x1db2('0xc')]=this[_0x1db2('0xd')]['id'];}else{_0x2091b4[_['upperFirst'](this[_0x1db2('0xe')])+_0x1db2('0xf')]=this[_0x1db2('0xd')]['id'];}_0x2091b4[_[_0x1db2('0x10')](this[_0x1db2('0xe')])+_0x1db2('0x11')]=this[_0x1db2('0x12')]['id'];if(rpc[this[_0x1db2('0xe')]+'Message']){return rpc[this[_0x1db2('0xe')]+_0x1db2('0x13')][_0x1db2('0x14')](_0x2091b4)[_0x1db2('0x15')](function(_0x93baf7){logger[_0x1db2('0x16')](_0x1db2('0x17'),_0x4732b6,_0x2091b4['body']);_0x1f5184[_0x1db2('0x18')]();})[_0x1db2('0x19')](function(_0x414336){logger[_0x1db2('0x1a')](_0x1db2('0x17'),_0x4732b6,JSON[_0x1db2('0x1b')](_0x414336));_0x1f5184[_0x1db2('0x1c')]();});}}catch(_0x371737){logger[_0x1db2('0x1a')](_0x1db2('0x17'),_0x4732b6,JSON[_0x1db2('0x1b')](_0x371737));_0x1f5184[_0x1db2('0x1c')]();}};};
\ 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