1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
17 // *************************************************************************
18 var _0x6156=['listen','loginMailFrequency','catch','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','then','refresh','mailAccounts'];(function(_0x5528c3,_0x35a416){var _0x47ec1b=function(_0x54a18e){while(--_0x54a18e){_0x5528c3['push'](_0x5528c3['shift']());}};_0x47ec1b(++_0x35a416);}(_0x6156,0x14f));var _0x6615=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x6156[_0x2dea24];return _0x309d58;};'use strict';var server=require(_0x6615('0x0'));var Realtime=require(_0x6615('0x1'));var EmailChannel=require(_0x6615('0x2'));var mailAccount=require(_0x6615('0x3'));var setting=require(_0x6615('0x4'));var logger=require(_0x6615('0x5'))(_0x6615('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0x6615('0x7')](mailAccount['getMailAccounts']())[_0x6615('0x7')](realtime['initMailAccounts']())['then'](function(){email[_0x6615('0x8')](realtime[_0x6615('0x9')]);return realtime;});}function main(){return server[_0x6615('0xa')](realtime,email)[_0x6615('0x7')](function(){return initRealtime();})[_0x6615('0x7')](function(){return setting['getSettings']();})['then'](function(_0x1db7e6){return setInterval(initRealtime,_0x1db7e6[_0x6615('0xb')]*0x3e8);})[_0x6615('0xc')](function(_0x1acf46){logger[_0x6615('0xd')](_0x6615('0xe'),_0x1acf46);});}main();