Built motion from commit 639a1a7f.|2.6.19
[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 _0x1fbb=['../model/mailAccount','mailAccounts','mapKeys','mergeFromDatabase','hasOwnProperty','prototype','initMailAccounts','isUndefined','exports','lodash'];(function(_0x35956a,_0x3fd43f){var _0x2f060c=function(_0x103e2c){while(--_0x103e2c){_0x35956a['push'](_0x35956a['shift']());}};_0x2f060c(++_0x3fd43f);}(_0x1fbb,0xdb));var _0xb1fb=function(_0x3ec9cd,_0x583fdb){_0x3ec9cd=_0x3ec9cd-0x0;var _0x9b02e8=_0x1fbb[_0x3ec9cd];return _0x9b02e8;};'use strict';var _=require(_0xb1fb('0x0'));var MailAccount=require(_0xb1fb('0x1'));var Realtime=function(){this[_0xb1fb('0x2')]={};};function freeIsNotKey(_0x55586b,_0x441489,_0x51756c){var _0x493d0f=_[_0xb1fb('0x3')](_0x55586b,function(_0x38be9f,_0x18433c){return _0x38be9f[_0x51756c];});for(var _0x5f3740 in _0x441489){if(_0x441489['hasOwnProperty'](_0x5f3740)){if(!_0x493d0f[_0x5f3740]){delete _0x441489[_0x5f3740];}}}}Realtime['prototype'][_0xb1fb('0x4')]=function(_0x4c21dd,_0x3d0bf8){for(var _0x12d40d in _0x3d0bf8){if(_0x4c21dd[_0xb1fb('0x5')](_0x12d40d)){_0x4c21dd[_0x12d40d]=_0x3d0bf8[_0x12d40d];}}};Realtime[_0xb1fb('0x6')][_0xb1fb('0x7')]=function(){var _0x311ae4=this;return function(_0x3e23d1){if(_0x3e23d1){freeIsNotKey(_0x3e23d1,_0x311ae4[_0xb1fb('0x2')],'id');for(var _0x136684=0x0,_0x517fcd={},_0x2d2af3={};_0x136684<_0x3e23d1['length'];_0x136684+=0x1){_0x517fcd=_0x3e23d1[_0x136684];if(_[_0xb1fb('0x8')](_0x311ae4[_0xb1fb('0x2')][_0x517fcd['id']])){_0x311ae4[_0xb1fb('0x2')][_0x517fcd['id']]=new MailAccount(_0x517fcd);}else{_['merge'](_0x311ae4[_0xb1fb('0x2')][_0x517fcd['id']],_0x517fcd);}}}return _0x311ae4[_0xb1fb('0x2')];};};module[_0xb1fb('0x9')]=Realtime;