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 _0xc21e=['getMailAccounts','then','initMailAccounts','refresh','mailAccounts','listen','Setting','findOne','loginMailFrequency','catch','./server','./realtime','./lib/email','./rpc/mailAccount','../../mysqldb','resolve'];(function(_0x3fb65b,_0x55aff0){var _0x54faa5=function(_0x2760a2){while(--_0x2760a2){_0x3fb65b['push'](_0x3fb65b['shift']());}};_0x54faa5(++_0x55aff0);}(_0xc21e,0x1ca));var _0xec21=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xc21e[_0x59ee6f];return _0x4c0979;};'use strict';var BPromise=require('bluebird');var server=require(_0xec21('0x0'));var Realtime=require(_0xec21('0x1'));var EmailChannel=require(_0xec21('0x2'));var mailAccount=require(_0xec21('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0xec21('0x4'))['db'];function initRealtime(){return BPromise[_0xec21('0x5')]()['then'](mailAccount[_0xec21('0x6')]())[_0xec21('0x7')](realtime[_0xec21('0x8')]())[_0xec21('0x7')](function(){email[_0xec21('0x9')](realtime[_0xec21('0xa')]);return realtime;});}function main(){return server[_0xec21('0xb')](realtime,email)[_0xec21('0x7')](function(_0x51f6dc){return initRealtime();})[_0xec21('0x7')](function(_0x3d74a2){return db[_0xec21('0xc')][_0xec21('0xd')]({'attributes':['id',_0xec21('0xe')],'raw':!![]});})['then'](function(_0x110420){return setInterval(initRealtime,_0x110420[_0xec21('0xe')]*0x3e8);})[_0xec21('0xf')](function(_0x4d13f0){console['log'](_0x4d13f0);});}main();