b13021cd7b7f9698ee92b330f3c24758b61439ea
[motion2.git] / server / services / email / realtime / 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 _0x34fc=['prototype','mailAccounts','length','isUndefined','merge','exports','lodash','../model/mailAccount','mapKeys','mergeFromDatabase','hasOwnProperty'];(function(_0x1b9530,_0x55b410){var _0x571515=function(_0x3e5f8e){while(--_0x3e5f8e){_0x1b9530['push'](_0x1b9530['shift']());}};_0x571515(++_0x55b410);}(_0x34fc,0x10e));var _0xc34f=function(_0x1fe769,_0x1f926b){_0x1fe769=_0x1fe769-0x0;var _0x225448=_0x34fc[_0x1fe769];return _0x225448;};'use strict';var _=require(_0xc34f('0x0'));var MailAccount=require(_0xc34f('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0xec9014,_0x53a2c8,_0x443a11){var _0x15e93c=_[_0xc34f('0x2')](_0xec9014,function(_0x58b18d,_0x5befbb){return _0x58b18d[_0x443a11];});for(var _0x4b1f25 in _0x53a2c8){if(_0x53a2c8['hasOwnProperty'](_0x4b1f25)){if(!_0x15e93c[_0x4b1f25]){delete _0x53a2c8[_0x4b1f25];}}}}Realtime['prototype'][_0xc34f('0x3')]=function(_0x2d2038,_0x17a1dc){for(var _0x535cb3 in _0x17a1dc){if(_0x2d2038[_0xc34f('0x4')](_0x535cb3)){_0x2d2038[_0x535cb3]=_0x17a1dc[_0x535cb3];}}};Realtime[_0xc34f('0x5')]['initMailAccounts']=function(){var _0x461544=this;return function(_0x587ecb){if(_0x587ecb){freeIsNotKey(_0x587ecb,_0x461544[_0xc34f('0x6')],'id');for(var _0x429279=0x0,_0x2fcbf3={},_0x161bf2={};_0x429279<_0x587ecb[_0xc34f('0x7')];_0x429279+=0x1){_0x2fcbf3=_0x587ecb[_0x429279];if(_[_0xc34f('0x8')](_0x461544[_0xc34f('0x6')][_0x2fcbf3['id']])){_0x461544['mailAccounts'][_0x2fcbf3['id']]=new MailAccount(_0x2fcbf3);}else{_[_0xc34f('0x9')](_0x461544['mailAccounts'][_0x2fcbf3['id']],_0x2fcbf3);}}}return _0x461544[_0xc34f('0x6')];};};module[_0xc34f('0xa')]=Realtime;