Built motion from commit 3c2ce842.|2.6.31
[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 _0x9f8f=['isUndefined','merge','exports','../model/mailAccount','mailAccounts','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length'];(function(_0x3b4b1d,_0x15029e){var _0x488c36=function(_0x56c8b3){while(--_0x56c8b3){_0x3b4b1d['push'](_0x3b4b1d['shift']());}};_0x488c36(++_0x15029e);}(_0x9f8f,0x85));var _0xf9f8=function(_0x16c19f,_0x2b2242){_0x16c19f=_0x16c19f-0x0;var _0x37eed1=_0x9f8f[_0x16c19f];return _0x37eed1;};'use strict';var _=require('lodash');var MailAccount=require(_0xf9f8('0x0'));var Realtime=function(){this[_0xf9f8('0x1')]={};};function freeIsNotKey(_0x36909e,_0x2c6be8,_0xbf356){var _0x478d54=_['mapKeys'](_0x36909e,function(_0x426900,_0x32785b){return _0x426900[_0xbf356];});for(var _0xd37036 in _0x2c6be8){if(_0x2c6be8[_0xf9f8('0x2')](_0xd37036)){if(!_0x478d54[_0xd37036]){delete _0x2c6be8[_0xd37036];}}}}Realtime[_0xf9f8('0x3')][_0xf9f8('0x4')]=function(_0x171d8a,_0x2e1795){for(var _0x199b28 in _0x2e1795){if(_0x171d8a[_0xf9f8('0x2')](_0x199b28)){_0x171d8a[_0x199b28]=_0x2e1795[_0x199b28];}}};Realtime[_0xf9f8('0x3')][_0xf9f8('0x5')]=function(){var _0x30a98d=this;return function(_0x5a901d){if(_0x5a901d){freeIsNotKey(_0x5a901d,_0x30a98d[_0xf9f8('0x1')],'id');for(var _0x4e9113=0x0,_0x5c9a31={},_0xae51a6={};_0x4e9113<_0x5a901d[_0xf9f8('0x6')];_0x4e9113+=0x1){_0x5c9a31=_0x5a901d[_0x4e9113];if(_[_0xf9f8('0x7')](_0x30a98d[_0xf9f8('0x1')][_0x5c9a31['id']])){_0x30a98d[_0xf9f8('0x1')][_0x5c9a31['id']]=new MailAccount(_0x5c9a31);}else{_[_0xf9f8('0x8')](_0x30a98d[_0xf9f8('0x1')][_0x5c9a31['id']],_0x5c9a31);}}}return _0x30a98d[_0xf9f8('0x1')];};};module[_0xf9f8('0x9')]=Realtime;