Built motion from commit 753c950e.|2.5.42
[motion2.git] / server / services / email / index.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
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.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x13db=['error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch'];(function(_0x560379,_0x991ccd){var _0x436d47=function(_0x1daed7){while(--_0x1daed7){_0x560379['push'](_0x560379['shift']());}};_0x436d47(++_0x991ccd);}(_0x13db,0x87));var _0xb13d=function(_0x318e32,_0x263c77){_0x318e32=_0x318e32-0x0;var _0x41538d=_0x13db[_0x318e32];return _0x41538d;};'use strict';var server=require(_0xb13d('0x0'));var Realtime=require(_0xb13d('0x1'));var EmailChannel=require(_0xb13d('0x2'));var mailAccount=require(_0xb13d('0x3'));var setting=require(_0xb13d('0x4'));var logger=require(_0xb13d('0x5'))(_0xb13d('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xb13d('0x7')]()[_0xb13d('0x8')](mailAccount[_0xb13d('0x9')]())[_0xb13d('0x8')](realtime[_0xb13d('0xa')]())[_0xb13d('0x8')](function(){email[_0xb13d('0xb')](realtime[_0xb13d('0xc')]);return realtime;});}function main(){return server[_0xb13d('0xd')](realtime,email)[_0xb13d('0x8')](function(){return initRealtime();})[_0xb13d('0x8')](function(){return setting[_0xb13d('0xe')]();})[_0xb13d('0x8')](function(_0x93c30d){return setInterval(initRealtime,_0x93c30d[_0xb13d('0xf')]*0x3e8);})[_0xb13d('0x10')](function(_0x54520e){logger[_0xb13d('0x11')](_0xb13d('0x12'),_0x54520e);});}main();