Built motion from commit (unavailable).|2.5.30
[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 _0xcfd6=['loginMailFrequency','catch','log','bluebird','./server','./lib/email','./rpc/mailAccount','./rpc/setting','resolve','getMailAccounts','then','refresh','mailAccounts','listen','getSettings'];(function(_0x5329e8,_0x1c6009){var _0x20b9a6=function(_0x2b63c9){while(--_0x2b63c9){_0x5329e8['push'](_0x5329e8['shift']());}};_0x20b9a6(++_0x1c6009);}(_0xcfd6,0x1c5));var _0x6cfd=function(_0x513e67,_0x3f7edc){_0x513e67=_0x513e67-0x0;var _0x4c8a78=_0xcfd6[_0x513e67];return _0x4c8a78;};'use strict';var BPromise=require(_0x6cfd('0x0'));var server=require(_0x6cfd('0x1'));var Realtime=require('./realtime');var EmailChannel=require(_0x6cfd('0x2'));var mailAccount=require(_0x6cfd('0x3'));var setting=require(_0x6cfd('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x6cfd('0x5')]()['then'](mailAccount[_0x6cfd('0x6')]())[_0x6cfd('0x7')](realtime['initMailAccounts']())[_0x6cfd('0x7')](function(){email[_0x6cfd('0x8')](realtime[_0x6cfd('0x9')]);return realtime;});}function main(){return server[_0x6cfd('0xa')](realtime,email)[_0x6cfd('0x7')](function(){return initRealtime();})[_0x6cfd('0x7')](function(){return setting[_0x6cfd('0xb')]();})[_0x6cfd('0x7')](function(_0xe8a67){return setInterval(initRealtime,_0xe8a67[_0x6cfd('0xc')]*0x3e8);})[_0x6cfd('0xd')](function(_0x39aa06){console[_0x6cfd('0xe')](_0x39aa06);});}main();