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 _0x31eb=['./rpc/mailAccount','resolve','then','getMailAccounts','initMailAccounts','mailAccounts','listen','log','./server','./realtime','./lib/email'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x31eb,0x173));var _0xb31e=function(_0x347d03,_0x225f4d){_0x347d03=_0x347d03-0x0;var _0x3ad538=_0x31eb[_0x347d03];return _0x3ad538;};'use strict';var BPromise=require('bluebird');var server=require(_0xb31e('0x0'));var Realtime=require(_0xb31e('0x1'));var EmailChannel=require(_0xb31e('0x2'));var mailAccount=require(_0xb31e('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xb31e('0x4')]()[_0xb31e('0x5')](mailAccount[_0xb31e('0x6')]())['then'](realtime[_0xb31e('0x7')]())[_0xb31e('0x5')](function(){email['refresh'](realtime[_0xb31e('0x8')]);return realtime;});}function main(){return server[_0xb31e('0x9')](realtime,email)['then'](function(_0x4bc177){return initRealtime();})[_0xb31e('0x5')](function(_0x1b3b65){return setInterval(initRealtime,0x2710);})['catch'](function(_0x22a226){console[_0xb31e('0xa')](_0x22a226);});}main();