Built motion from commit 67e5df37.|2.0.66
[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 _0x49e4=['refresh','listen','catch','bluebird','./realtime','./rpc/mailAccount','resolve','then','getMailAccounts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x49e4,0x111));var _0x449e=function(_0xbcffcb,_0x6269ba){_0xbcffcb=_0xbcffcb-0x0;var _0x5045c3=_0x49e4[_0xbcffcb];return _0x5045c3;};'use strict';var BPromise=require(_0x449e('0x0'));var server=require('./server');var Realtime=require(_0x449e('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x449e('0x2'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x449e('0x3')]()[_0x449e('0x4')](mailAccount[_0x449e('0x5')]())['then'](realtime['initMailAccounts']())[_0x449e('0x4')](function(){email[_0x449e('0x6')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x449e('0x7')](realtime,email)['then'](function(_0xcceb9a){return initRealtime();})[_0x449e('0x4')](function(_0x14bc03){return setInterval(initRealtime,0x2710);})[_0x449e('0x8')](function(_0x20f1c9){console['log'](_0x20f1c9);});}main();