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 _0x74dd=['log','bluebird','./server','./lib/email','./rpc/mailAccount','./rpc/setting','then','getMailAccounts','initMailAccounts','mailAccounts','listen','getSettings','loginMailFrequency','catch'];(function(_0xed930f,_0x3391ca){var _0x53c346=function(_0x4b636f){while(--_0x4b636f){_0xed930f['push'](_0xed930f['shift']());}};_0x53c346(++_0x3391ca);}(_0x74dd,0x16d));var _0xd74d=function(_0x37fcda,_0x2f5aa1){_0x37fcda=_0x37fcda-0x0;var _0xf5ed91=_0x74dd[_0x37fcda];return _0xf5ed91;};'use strict';var BPromise=require(_0xd74d('0x0'));var server=require(_0xd74d('0x1'));var Realtime=require('./realtime');var EmailChannel=require(_0xd74d('0x2'));var mailAccount=require(_0xd74d('0x3'));var setting=require(_0xd74d('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()[_0xd74d('0x5')](mailAccount[_0xd74d('0x6')]())[_0xd74d('0x5')](realtime[_0xd74d('0x7')]())['then'](function(){email['refresh'](realtime[_0xd74d('0x8')]);return realtime;});}function main(){return server[_0xd74d('0x9')](realtime,email)[_0xd74d('0x5')](function(){return initRealtime();})[_0xd74d('0x5')](function(){return setting[_0xd74d('0xa')]();})[_0xd74d('0x5')](function(_0x36c872){return setInterval(initRealtime,_0x36c872[_0xd74d('0xb')]*0x3e8);})[_0xd74d('0xc')](function(_0x1fc576){console[_0xd74d('0xd')](_0x1fc576);});}main();