Built motion from commit e6806ed6.|2.6.0
[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 _0xb6d0=['mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','isUndefined','merge','exports','lodash','../model/mailAccount'];(function(_0x553150,_0x589ff3){var _0x18193d=function(_0x3a5ae6){while(--_0x3a5ae6){_0x553150['push'](_0x553150['shift']());}};_0x18193d(++_0x589ff3);}(_0xb6d0,0x120));var _0x0b6d=function(_0xbaf094,_0x2f86ad){_0xbaf094=_0xbaf094-0x0;var _0x3974fd=_0xb6d0[_0xbaf094];return _0x3974fd;};'use strict';var _=require(_0x0b6d('0x0'));var MailAccount=require(_0x0b6d('0x1'));var Realtime=function(){this[_0x0b6d('0x2')]={};};function freeIsNotKey(_0x2d5d88,_0x38eab5,_0x2847c3){var _0x2e1aa3=_[_0x0b6d('0x3')](_0x2d5d88,function(_0x3a30c4,_0x1506dd){return _0x3a30c4[_0x2847c3];});for(var _0x11fdcd in _0x38eab5){if(_0x38eab5[_0x0b6d('0x4')](_0x11fdcd)){if(!_0x2e1aa3[_0x11fdcd]){delete _0x38eab5[_0x11fdcd];}}}}Realtime[_0x0b6d('0x5')][_0x0b6d('0x6')]=function(_0x59087a,_0x4320f9){for(var _0x285cf4 in _0x4320f9){if(_0x59087a[_0x0b6d('0x4')](_0x285cf4)){_0x59087a[_0x285cf4]=_0x4320f9[_0x285cf4];}}};Realtime[_0x0b6d('0x5')]['initMailAccounts']=function(){var _0x581d58=this;return function(_0x17514e){if(_0x17514e){freeIsNotKey(_0x17514e,_0x581d58[_0x0b6d('0x2')],'id');for(var _0x35d89e=0x0,_0x3cdd0b={},_0x21c835={};_0x35d89e<_0x17514e['length'];_0x35d89e+=0x1){_0x3cdd0b=_0x17514e[_0x35d89e];if(_[_0x0b6d('0x7')](_0x581d58['mailAccounts'][_0x3cdd0b['id']])){_0x581d58['mailAccounts'][_0x3cdd0b['id']]=new MailAccount(_0x3cdd0b);}else{_[_0x0b6d('0x8')](_0x581d58[_0x0b6d('0x2')][_0x3cdd0b['id']],_0x3cdd0b);}}}return _0x581d58[_0x0b6d('0x2')];};};module[_0x0b6d('0x9')]=Realtime;