Built motion from commit ab870f9e.|2.5.44
[motion2.git] / server / services / routing / server / applications / message.js
index 863dcc2..2520f5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa393=['[%s][MESSAGE]\x20%s','stop','stringify','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','contact','channel','ChatWebsiteId','upperFirst','AccountId','InteractionId','interaction','Message','create','info','body','next','catch','error'];(function(_0x27ff35,_0x43abb8){var _0x18138f=function(_0x4ea812){while(--_0x4ea812){_0x27ff35['push'](_0x27ff35['shift']());}};_0x18138f(++_0x43abb8);}(_0xa393,0x12f));var _0x3a39=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0xa393[_0x231e16];return _0x570a7c;};'use strict';var _=require(_0x3a39('0x0'));var utils=require(_0x3a39('0x1'));var logger=require('../../../../config/logger')(_0x3a39('0x2'));var rpc={'chatMessage':require(_0x3a39('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x3a39('0x4')),'smsMessage':require(_0x3a39('0x5')),'faxMessage':require(_0x3a39('0x6')),'whatsappMessage':require(_0x3a39('0x7'))};exports['consequence']=function(_0x1134e9,_0x388c58){return function(_0x3815a4){try{var _0x1fa116={'body':utils['getMustacheRender'](_0x388c58[0x0],this),'ContactId':this[_0x3a39('0x8')]['id']};if(this[_0x3a39('0x9')]==='chat'){_0x1fa116[_0x3a39('0xa')]=this['account']['id'];}else{_0x1fa116[_[_0x3a39('0xb')](this[_0x3a39('0x9')])+_0x3a39('0xc')]=this['account']['id'];}_0x1fa116[_[_0x3a39('0xb')](this[_0x3a39('0x9')])+_0x3a39('0xd')]=this[_0x3a39('0xe')]['id'];if(rpc[this[_0x3a39('0x9')]+_0x3a39('0xf')]){return rpc[this[_0x3a39('0x9')]+_0x3a39('0xf')][_0x3a39('0x10')](_0x1fa116)['then'](function(_0x48f378){logger[_0x3a39('0x11')]('[%s][MESSAGE]\x20%s',_0x1134e9,_0x1fa116[_0x3a39('0x12')]);_0x3815a4[_0x3a39('0x13')]();})[_0x3a39('0x14')](function(_0x5d5fc7){logger[_0x3a39('0x15')](_0x3a39('0x16'),_0x1134e9,JSON['stringify'](_0x5d5fc7));_0x3815a4[_0x3a39('0x17')]();});}}catch(_0x2950b7){logger[_0x3a39('0x15')](_0x3a39('0x16'),_0x1134e9,JSON[_0x3a39('0x18')](_0x2950b7));_0x3815a4[_0x3a39('0x17')]();}};};
\ No newline at end of file
+var _0x11fa=['Message','create','then','info','[%s][MESSAGE]\x20%s','body','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId'];(function(_0x1c37a5,_0x59ee51){var _0x389d03=function(_0x51b4f4){while(--_0x51b4f4){_0x1c37a5['push'](_0x1c37a5['shift']());}};_0x389d03(++_0x59ee51);}(_0x11fa,0xa0));var _0xa11f=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x11fa[_0x36884e];return _0x1cc367;};'use strict';var _=require(_0xa11f('0x0'));var utils=require(_0xa11f('0x1'));var logger=require(_0xa11f('0x2'))(_0xa11f('0x3'));var rpc={'chatMessage':require(_0xa11f('0x4')),'openchannelMessage':require(_0xa11f('0x5')),'mailMessage':require(_0xa11f('0x6')),'smsMessage':require(_0xa11f('0x7')),'faxMessage':require(_0xa11f('0x8')),'whatsappMessage':require(_0xa11f('0x9'))};exports[_0xa11f('0xa')]=function(_0x2e79f3,_0x550d8c){return function(_0x4e42d3){try{var _0x10d3be={'body':utils[_0xa11f('0xb')](_0x550d8c[0x0],this),'ContactId':this[_0xa11f('0xc')]['id']};if(this[_0xa11f('0xd')]===_0xa11f('0xe')){_0x10d3be[_0xa11f('0xf')]=this['account']['id'];}else{_0x10d3be[_[_0xa11f('0x10')](this[_0xa11f('0xd')])+_0xa11f('0x11')]=this[_0xa11f('0x12')]['id'];}_0x10d3be[_[_0xa11f('0x10')](this[_0xa11f('0xd')])+_0xa11f('0x13')]=this['interaction']['id'];if(rpc[this['channel']+'Message']){return rpc[this[_0xa11f('0xd')]+_0xa11f('0x14')][_0xa11f('0x15')](_0x10d3be)[_0xa11f('0x16')](function(_0x426aa5){logger[_0xa11f('0x17')](_0xa11f('0x18'),_0x2e79f3,_0x10d3be[_0xa11f('0x19')]);_0x4e42d3['next']();})[_0xa11f('0x1a')](function(_0x197738){logger[_0xa11f('0x1b')](_0xa11f('0x18'),_0x2e79f3,JSON[_0xa11f('0x1c')](_0x197738));_0x4e42d3[_0xa11f('0x1d')]();});}}catch(_0x5e1e4e){logger['error']('[%s][MESSAGE]\x20%s',_0x2e79f3,JSON[_0xa11f('0x1c')](_0x5e1e4e));_0x4e42d3['stop']();}};};
\ No newline at end of file