Built motion from commit 1fa89557.|2.6.10
[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 _0xb98a=['./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','then','getMailAccounts','initMailAccounts','refresh','listen','getSettings','loginMailFrequency','catch','error','./server'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xb98a,0xfe));var _0xab98=function(_0x81fc31,_0x151260){_0x81fc31=_0x81fc31-0x0;var _0x3c1234=_0xb98a[_0x81fc31];return _0x3c1234;};'use strict';var server=require(_0xab98('0x0'));var Realtime=require(_0xab98('0x1'));var EmailChannel=require(_0xab98('0x2'));var mailAccount=require(_0xab98('0x3'));var setting=require(_0xab98('0x4'));var logger=require(_0xab98('0x5'))(_0xab98('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xab98('0x7')]()[_0xab98('0x8')](mailAccount[_0xab98('0x9')]())[_0xab98('0x8')](realtime[_0xab98('0xa')]())[_0xab98('0x8')](function(){email[_0xab98('0xb')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xab98('0xc')](realtime,email)[_0xab98('0x8')](function(){return initRealtime();})['then'](function(){return setting[_0xab98('0xd')]();})[_0xab98('0x8')](function(_0x319388){return setInterval(initRealtime,_0x319388[_0xab98('0xe')]*0x3e8);})[_0xab98('0xf')](function(_0x56c347){logger[_0xab98('0x10')]('Email\x20service\x20initialization',_0x56c347);});}main();