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 _0x6a7e=['listen','loginMailFrequency','catch','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/setting','../../config/logger','resolve','getMailAccounts','initMailAccounts','then','refresh'];(function(_0x1a957b,_0x3a5dca){var _0x2b79f4=function(_0x113582){while(--_0x113582){_0x1a957b['push'](_0x1a957b['shift']());}};_0x2b79f4(++_0x3a5dca);}(_0x6a7e,0x138));var _0xe6a7=function(_0x50507f,_0x5e29e9){_0x50507f=_0x50507f-0x0;var _0x242b06=_0x6a7e[_0x50507f];return _0x242b06;};'use strict';var server=require(_0xe6a7('0x0'));var Realtime=require(_0xe6a7('0x1'));var EmailChannel=require(_0xe6a7('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0xe6a7('0x3'));var logger=require(_0xe6a7('0x4'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xe6a7('0x5')]()['then'](mailAccount[_0xe6a7('0x6')]())['then'](realtime[_0xe6a7('0x7')]())[_0xe6a7('0x8')](function(){email[_0xe6a7('0x9')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xe6a7('0xa')](realtime,email)[_0xe6a7('0x8')](function(){return initRealtime();})['then'](function(){return setting['getSettings']();})[_0xe6a7('0x8')](function(_0x5d1e53){return setInterval(initRealtime,_0x5d1e53[_0xe6a7('0xb')]*0x3e8);})[_0xe6a7('0xc')](function(_0x130c98){logger['error'](_0xe6a7('0xd'),_0x130c98);});}main();