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 _0xcc1e=['merge','exports','lodash','../model/mailAccount','prototype','mergeFromDatabase','hasOwnProperty','initMailAccounts','mailAccounts'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xcc1e,0x1b2));var _0xecc1=function(_0x450cba,_0x749b5c){_0x450cba=_0x450cba-0x0;var _0x524129=_0xcc1e[_0x450cba];return _0x524129;};'use strict';var _=require(_0xecc1('0x0'));var MailAccount=require(_0xecc1('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x12e2f5,_0x373925,_0x2d3310){var _0x4a3ce6=_['mapKeys'](_0x12e2f5,function(_0x589069,_0x57db22){return _0x589069[_0x2d3310];});for(var _0x4c1730 in _0x373925){if(_0x373925['hasOwnProperty'](_0x4c1730)){if(!_0x4a3ce6[_0x4c1730]){delete _0x373925[_0x4c1730];}}}}Realtime[_0xecc1('0x2')][_0xecc1('0x3')]=function(_0x3fec86,_0x4d9cf7){for(var _0x4d8594 in _0x4d9cf7){if(_0x3fec86[_0xecc1('0x4')](_0x4d8594)){_0x3fec86[_0x4d8594]=_0x4d9cf7[_0x4d8594];}}};Realtime[_0xecc1('0x2')][_0xecc1('0x5')]=function(){var _0x2452b8=this;return function(_0x2c453e){if(_0x2c453e){freeIsNotKey(_0x2c453e,_0x2452b8[_0xecc1('0x6')],'id');for(var _0x55bc13=0x0,_0x2e97f8={},_0x378a18={};_0x55bc13<_0x2c453e['length'];_0x55bc13+=0x1){_0x2e97f8=_0x2c453e[_0x55bc13];if(_['isUndefined'](_0x2452b8['mailAccounts'][_0x2e97f8['id']])){_0x2452b8['mailAccounts'][_0x2e97f8['id']]=new MailAccount(_0x2e97f8);}else{_[_0xecc1('0x7')](_0x2452b8[_0xecc1('0x6')][_0x2e97f8['id']],_0x2e97f8);}}}return _0x2452b8['mailAccounts'];};};module[_0xecc1('0x8')]=Realtime;