Built motion from commit 14588770.|2.5.38
[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 _0xdf05=['prototype','initMailAccounts','length','isUndefined','mailAccounts','merge','exports','lodash','../model/mailAccount','mapKeys','hasOwnProperty','mergeFromDatabase'];(function(_0x19a7f6,_0x3abadc){var _0x5831b8=function(_0x555adc){while(--_0x555adc){_0x19a7f6['push'](_0x19a7f6['shift']());}};_0x5831b8(++_0x3abadc);}(_0xdf05,0x8b));var _0x5df0=function(_0x57d867,_0x2ee50b){_0x57d867=_0x57d867-0x0;var _0x33d270=_0xdf05[_0x57d867];return _0x33d270;};'use strict';var _=require(_0x5df0('0x0'));var MailAccount=require(_0x5df0('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x406028,_0x39b7d6,_0x25477d){var _0x48c8dd=_[_0x5df0('0x2')](_0x406028,function(_0x254189,_0x5b800b){return _0x254189[_0x25477d];});for(var _0x6da1aa in _0x39b7d6){if(_0x39b7d6[_0x5df0('0x3')](_0x6da1aa)){if(!_0x48c8dd[_0x6da1aa]){delete _0x39b7d6[_0x6da1aa];}}}}Realtime['prototype'][_0x5df0('0x4')]=function(_0xb8ebf,_0x4100fb){for(var _0x4495b5 in _0x4100fb){if(_0xb8ebf[_0x5df0('0x3')](_0x4495b5)){_0xb8ebf[_0x4495b5]=_0x4100fb[_0x4495b5];}}};Realtime[_0x5df0('0x5')][_0x5df0('0x6')]=function(){var _0x548d96=this;return function(_0x2d2931){if(_0x2d2931){freeIsNotKey(_0x2d2931,_0x548d96['mailAccounts'],'id');for(var _0xea84d1=0x0,_0x3757f9={},_0x4eba85={};_0xea84d1<_0x2d2931[_0x5df0('0x7')];_0xea84d1+=0x1){_0x3757f9=_0x2d2931[_0xea84d1];if(_[_0x5df0('0x8')](_0x548d96[_0x5df0('0x9')][_0x3757f9['id']])){_0x548d96['mailAccounts'][_0x3757f9['id']]=new MailAccount(_0x3757f9);}else{_[_0x5df0('0xa')](_0x548d96[_0x5df0('0x9')][_0x3757f9['id']],_0x3757f9);}}}return _0x548d96[_0x5df0('0x9')];};};module[_0x5df0('0xb')]=Realtime;