Built motion from commit 9d0783e6.|2.6.13
[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 _0x4fcb=['hasOwnProperty','mergeFromDatabase','prototype','initMailAccounts','length','isUndefined','merge','exports','lodash','mailAccounts'];(function(_0x95efe,_0x396e41){var _0x39cbea=function(_0x43a6d8){while(--_0x43a6d8){_0x95efe['push'](_0x95efe['shift']());}};_0x39cbea(++_0x396e41);}(_0x4fcb,0x17a));var _0xb4fc=function(_0xf7eaf9,_0x3d383d){_0xf7eaf9=_0xf7eaf9-0x0;var _0x8e5c1b=_0x4fcb[_0xf7eaf9];return _0x8e5c1b;};'use strict';var _=require(_0xb4fc('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0xb4fc('0x1')]={};};function freeIsNotKey(_0x99417,_0x591fc4,_0x5e5265){var _0x3c6f8d=_['mapKeys'](_0x99417,function(_0x1ea925,_0x9be2b1){return _0x1ea925[_0x5e5265];});for(var _0x19306c in _0x591fc4){if(_0x591fc4[_0xb4fc('0x2')](_0x19306c)){if(!_0x3c6f8d[_0x19306c]){delete _0x591fc4[_0x19306c];}}}}Realtime['prototype'][_0xb4fc('0x3')]=function(_0x5d296c,_0x559d5b){for(var _0x12b61b in _0x559d5b){if(_0x5d296c[_0xb4fc('0x2')](_0x12b61b)){_0x5d296c[_0x12b61b]=_0x559d5b[_0x12b61b];}}};Realtime[_0xb4fc('0x4')][_0xb4fc('0x5')]=function(){var _0x80400c=this;return function(_0x16fd2d){if(_0x16fd2d){freeIsNotKey(_0x16fd2d,_0x80400c[_0xb4fc('0x1')],'id');for(var _0x21d322=0x0,_0xbe9e7={},_0x2dca80={};_0x21d322<_0x16fd2d[_0xb4fc('0x6')];_0x21d322+=0x1){_0xbe9e7=_0x16fd2d[_0x21d322];if(_[_0xb4fc('0x7')](_0x80400c[_0xb4fc('0x1')][_0xbe9e7['id']])){_0x80400c['mailAccounts'][_0xbe9e7['id']]=new MailAccount(_0xbe9e7);}else{_[_0xb4fc('0x8')](_0x80400c[_0xb4fc('0x1')][_0xbe9e7['id']],_0xbe9e7);}}}return _0x80400c['mailAccounts'];};};module[_0xb4fc('0x9')]=Realtime;