Built motion from commit (unavailable).|2.5.23
[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 _0xf1d0=['prototype','mergeFromDatabase','initMailAccounts','isUndefined','merge','lodash','../model/mailAccount','mailAccounts','hasOwnProperty'];(function(_0x2f4584,_0x4bd73d){var _0x41f013=function(_0x235e65){while(--_0x235e65){_0x2f4584['push'](_0x2f4584['shift']());}};_0x41f013(++_0x4bd73d);}(_0xf1d0,0xdd));var _0x0f1d=function(_0x2b9553,_0x5c2c1a){_0x2b9553=_0x2b9553-0x0;var _0x4c02cc=_0xf1d0[_0x2b9553];return _0x4c02cc;};'use strict';var _=require(_0x0f1d('0x0'));var MailAccount=require(_0x0f1d('0x1'));var Realtime=function(){this[_0x0f1d('0x2')]={};};function freeIsNotKey(_0x53c233,_0xb4cf3d,_0xf2e8db){var _0x1dbc78=_['mapKeys'](_0x53c233,function(_0x19c694,_0x56ba11){return _0x19c694[_0xf2e8db];});for(var _0x2f5eea in _0xb4cf3d){if(_0xb4cf3d[_0x0f1d('0x3')](_0x2f5eea)){if(!_0x1dbc78[_0x2f5eea]){delete _0xb4cf3d[_0x2f5eea];}}}}Realtime[_0x0f1d('0x4')][_0x0f1d('0x5')]=function(_0x11a15b,_0x4335df){for(var _0x44e82e in _0x4335df){if(_0x11a15b['hasOwnProperty'](_0x44e82e)){_0x11a15b[_0x44e82e]=_0x4335df[_0x44e82e];}}};Realtime['prototype'][_0x0f1d('0x6')]=function(){var _0x77c118=this;return function(_0xf9ed79){if(_0xf9ed79){freeIsNotKey(_0xf9ed79,_0x77c118[_0x0f1d('0x2')],'id');for(var _0x562add=0x0,_0x39dacf={},_0x446b0e={};_0x562add<_0xf9ed79['length'];_0x562add+=0x1){_0x39dacf=_0xf9ed79[_0x562add];if(_[_0x0f1d('0x7')](_0x77c118[_0x0f1d('0x2')][_0x39dacf['id']])){_0x77c118[_0x0f1d('0x2')][_0x39dacf['id']]=new MailAccount(_0x39dacf);}else{_[_0x0f1d('0x8')](_0x77c118[_0x0f1d('0x2')][_0x39dacf['id']],_0x39dacf);}}}return _0x77c118[_0x0f1d('0x2')];};};module['exports']=Realtime;