a8ff950bffcfa7c747be712027d3d8b2768f0a3a
[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 _0x729c=['mapKeys','prototype','mergeFromDatabase','hasOwnProperty','initMailAccounts','mailAccounts','merge','exports','lodash','../model/mailAccount'];(function(_0x485e1d,_0x452c88){var _0x376f1d=function(_0x2f24d8){while(--_0x2f24d8){_0x485e1d['push'](_0x485e1d['shift']());}};_0x376f1d(++_0x452c88);}(_0x729c,0x6c));var _0xc729=function(_0x40e99f,_0x16974e){_0x40e99f=_0x40e99f-0x0;var _0x536f70=_0x729c[_0x40e99f];return _0x536f70;};'use strict';var _=require(_0xc729('0x0'));var MailAccount=require(_0xc729('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x2594f8,_0x3dc5a9,_0xa46d4b){var _0x3c5538=_[_0xc729('0x2')](_0x2594f8,function(_0x2e87fd,_0x1636f6){return _0x2e87fd[_0xa46d4b];});for(var _0x26d025 in _0x3dc5a9){if(_0x3dc5a9['hasOwnProperty'](_0x26d025)){if(!_0x3c5538[_0x26d025]){delete _0x3dc5a9[_0x26d025];}}}}Realtime[_0xc729('0x3')][_0xc729('0x4')]=function(_0x4472be,_0xa058da){for(var _0x435326 in _0xa058da){if(_0x4472be[_0xc729('0x5')](_0x435326)){_0x4472be[_0x435326]=_0xa058da[_0x435326];}}};Realtime[_0xc729('0x3')][_0xc729('0x6')]=function(){var _0x4a0f4f=this;return function(_0x74f718){if(_0x74f718){freeIsNotKey(_0x74f718,_0x4a0f4f['mailAccounts'],'id');for(var _0x37efab=0x0,_0x52aa61={},_0x324dc8={};_0x37efab<_0x74f718['length'];_0x37efab+=0x1){_0x52aa61=_0x74f718[_0x37efab];if(_['isUndefined'](_0x4a0f4f['mailAccounts'][_0x52aa61['id']])){_0x4a0f4f[_0xc729('0x7')][_0x52aa61['id']]=new MailAccount(_0x52aa61);}else{_[_0xc729('0x8')](_0x4a0f4f['mailAccounts'][_0x52aa61['id']],_0x52aa61);}}}return _0x4a0f4f[_0xc729('0x7')];};};module[_0xc729('0x9')]=Realtime;