Built motion from commit 3770a7bd.|2.6.29
[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 _0x5acb=['mapKeys','hasOwnProperty','mergeFromDatabase','prototype','initMailAccounts','mailAccounts','length','isUndefined','merge','lodash','../model/mailAccount'];(function(_0x5d4ca7,_0x19113b){var _0x3efc03=function(_0x59675b){while(--_0x59675b){_0x5d4ca7['push'](_0x5d4ca7['shift']());}};_0x3efc03(++_0x19113b);}(_0x5acb,0x13d));var _0xb5ac=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5acb[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xb5ac('0x0'));var MailAccount=require(_0xb5ac('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x1e0b61,_0x5bdb0d,_0x330611){var _0x35716e=_[_0xb5ac('0x2')](_0x1e0b61,function(_0x2da4f9,_0x5a7c9f){return _0x2da4f9[_0x330611];});for(var _0x5842c in _0x5bdb0d){if(_0x5bdb0d[_0xb5ac('0x3')](_0x5842c)){if(!_0x35716e[_0x5842c]){delete _0x5bdb0d[_0x5842c];}}}}Realtime['prototype'][_0xb5ac('0x4')]=function(_0x555e7a,_0x4c9a53){for(var _0x26f502 in _0x4c9a53){if(_0x555e7a['hasOwnProperty'](_0x26f502)){_0x555e7a[_0x26f502]=_0x4c9a53[_0x26f502];}}};Realtime[_0xb5ac('0x5')][_0xb5ac('0x6')]=function(){var _0x44c601=this;return function(_0x2321a0){if(_0x2321a0){freeIsNotKey(_0x2321a0,_0x44c601[_0xb5ac('0x7')],'id');for(var _0x27624d=0x0,_0x176434={},_0x507dd1={};_0x27624d<_0x2321a0[_0xb5ac('0x8')];_0x27624d+=0x1){_0x176434=_0x2321a0[_0x27624d];if(_[_0xb5ac('0x9')](_0x44c601[_0xb5ac('0x7')][_0x176434['id']])){_0x44c601[_0xb5ac('0x7')][_0x176434['id']]=new MailAccount(_0x176434);}else{_[_0xb5ac('0xa')](_0x44c601[_0xb5ac('0x7')][_0x176434['id']],_0x176434);}}}return _0x44c601['mailAccounts'];};};module['exports']=Realtime;