Built motion from commit 00bf23f6.|2.6.16
[motion2.git] / server / services / routing / server / applications / message.js
index 87c7f80..1ebedb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x105f=['Message','create','[%s][MESSAGE]\x20%s','body','next','stringify','stop','error','./utils','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','channel','chat','ChatWebsiteId','account','upperFirst','interaction'];(function(_0xd9acb4,_0x153a82){var _0x479cc2=function(_0x30fcbe){while(--_0x30fcbe){_0xd9acb4['push'](_0xd9acb4['shift']());}};_0x479cc2(++_0x153a82);}(_0x105f,0x71));var _0xf105=function(_0x1ea185,_0x27e48d){_0x1ea185=_0x1ea185-0x0;var _0x4ac9e3=_0x105f[_0x1ea185];return _0x4ac9e3;};'use strict';var _=require('lodash');var utils=require(_0xf105('0x0'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xf105('0x1')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xf105('0x2')),'faxMessage':require(_0xf105('0x3')),'whatsappMessage':require(_0xf105('0x4'))};exports[_0xf105('0x5')]=function(_0x58224e,_0x374059){return function(_0x100675){try{var _0x5f4946={'body':utils[_0xf105('0x6')](_0x374059[0x0],this),'ContactId':this['contact']['id']};if(this[_0xf105('0x7')]===_0xf105('0x8')){_0x5f4946[_0xf105('0x9')]=this[_0xf105('0xa')]['id'];}else{_0x5f4946[_['upperFirst'](this['channel'])+'AccountId']=this['account']['id'];}_0x5f4946[_[_0xf105('0xb')](this[_0xf105('0x7')])+'InteractionId']=this[_0xf105('0xc')]['id'];if(rpc[this[_0xf105('0x7')]+_0xf105('0xd')]){return rpc[this[_0xf105('0x7')]+_0xf105('0xd')][_0xf105('0xe')](_0x5f4946)['then'](function(_0x2f2dd5){logger['info'](_0xf105('0xf'),_0x58224e,_0x5f4946[_0xf105('0x10')]);_0x100675[_0xf105('0x11')]();})['catch'](function(_0x26b7b6){logger['error']('[%s][MESSAGE]\x20%s',_0x58224e,JSON[_0xf105('0x12')](_0x26b7b6));_0x100675[_0xf105('0x13')]();});}}catch(_0x24dd40){logger[_0xf105('0x14')](_0xf105('0xf'),_0x58224e,JSON['stringify'](_0x24dd40));_0x100675[_0xf105('0x13')]();}};};
\ No newline at end of file
+var _0xf6f6=['channel','AccountId','account','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','next','error','stringify','stop','lodash','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','chat','ChatWebsiteId','upperFirst'];(function(_0x1b70e3,_0x3a15b1){var _0x1452ab=function(_0x692883){while(--_0x692883){_0x1b70e3['push'](_0x1b70e3['shift']());}};_0x1452ab(++_0x3a15b1);}(_0xf6f6,0x15e));var _0x6f6f=function(_0x3b7b8a,_0x52c3b0){_0x3b7b8a=_0x3b7b8a-0x0;var _0x441206=_0xf6f6[_0x3b7b8a];return _0x441206;};'use strict';var _=require(_0x6f6f('0x0'));var utils=require('./utils');var logger=require(_0x6f6f('0x1'))(_0x6f6f('0x2'));var rpc={'chatMessage':require(_0x6f6f('0x3')),'openchannelMessage':require(_0x6f6f('0x4')),'mailMessage':require(_0x6f6f('0x5')),'smsMessage':require(_0x6f6f('0x6')),'faxMessage':require(_0x6f6f('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x6f6f('0x8')]=function(_0x32526a,_0xa2d4e7){return function(_0xa0a462){try{var _0x3a2da7={'body':utils[_0x6f6f('0x9')](_0xa2d4e7[0x0],this),'ContactId':this[_0x6f6f('0xa')]['id']};if(this['channel']===_0x6f6f('0xb')){_0x3a2da7[_0x6f6f('0xc')]=this['account']['id'];}else{_0x3a2da7[_[_0x6f6f('0xd')](this[_0x6f6f('0xe')])+_0x6f6f('0xf')]=this[_0x6f6f('0x10')]['id'];}_0x3a2da7[_[_0x6f6f('0xd')](this[_0x6f6f('0xe')])+_0x6f6f('0x11')]=this[_0x6f6f('0x12')]['id'];if(rpc[this['channel']+_0x6f6f('0x13')]){return rpc[this['channel']+'Message'][_0x6f6f('0x14')](_0x3a2da7)[_0x6f6f('0x15')](function(_0x5f1fc5){logger[_0x6f6f('0x16')](_0x6f6f('0x17'),_0x32526a,_0x3a2da7['body']);_0xa0a462[_0x6f6f('0x18')]();})['catch'](function(_0x2482d6){logger[_0x6f6f('0x19')](_0x6f6f('0x17'),_0x32526a,JSON['stringify'](_0x2482d6));_0xa0a462['stop']();});}}catch(_0x34a259){logger[_0x6f6f('0x19')]('[%s][MESSAGE]\x20%s',_0x32526a,JSON[_0x6f6f('0x1a')](_0x34a259));_0xa0a462[_0x6f6f('0x1b')]();}};};
\ No newline at end of file