Built motion from commit (unavailable).|2.5.28
[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 _0xfcc3=['exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','initMailAccounts','length','merge'];(function(_0xd8f63d,_0x2865f2){var _0x173bed=function(_0x516f1f){while(--_0x516f1f){_0xd8f63d['push'](_0xd8f63d['shift']());}};_0x173bed(++_0x2865f2);}(_0xfcc3,0xd3));var _0x3fcc=function(_0x4c792b,_0x156f42){_0x4c792b=_0x4c792b-0x0;var _0x2d6267=_0xfcc3[_0x4c792b];return _0x2d6267;};'use strict';var _=require(_0x3fcc('0x0'));var MailAccount=require(_0x3fcc('0x1'));var Realtime=function(){this[_0x3fcc('0x2')]={};};function freeIsNotKey(_0x4c93b6,_0x3b62fc,_0x523c4b){var _0x730cd8=_[_0x3fcc('0x3')](_0x4c93b6,function(_0x423e4b,_0x658819){return _0x423e4b[_0x523c4b];});for(var _0x59cfe0 in _0x3b62fc){if(_0x3b62fc[_0x3fcc('0x4')](_0x59cfe0)){if(!_0x730cd8[_0x59cfe0]){delete _0x3b62fc[_0x59cfe0];}}}}Realtime[_0x3fcc('0x5')]['mergeFromDatabase']=function(_0x2e3902,_0x446d0d){for(var _0x5e7532 in _0x446d0d){if(_0x2e3902[_0x3fcc('0x4')](_0x5e7532)){_0x2e3902[_0x5e7532]=_0x446d0d[_0x5e7532];}}};Realtime[_0x3fcc('0x5')][_0x3fcc('0x6')]=function(){var _0xaf6985=this;return function(_0x4d3207){if(_0x4d3207){freeIsNotKey(_0x4d3207,_0xaf6985[_0x3fcc('0x2')],'id');for(var _0x38afbb=0x0,_0x2b787f={},_0x6d9129={};_0x38afbb<_0x4d3207[_0x3fcc('0x7')];_0x38afbb+=0x1){_0x2b787f=_0x4d3207[_0x38afbb];if(_['isUndefined'](_0xaf6985['mailAccounts'][_0x2b787f['id']])){_0xaf6985[_0x3fcc('0x2')][_0x2b787f['id']]=new MailAccount(_0x2b787f);}else{_[_0x3fcc('0x8')](_0xaf6985[_0x3fcc('0x2')][_0x2b787f['id']],_0x2b787f);}}}return _0xaf6985['mailAccounts'];};};module[_0x3fcc('0x9')]=Realtime;