Built motion from commit (unavailable).|2.5.2
[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 _0x8970=['mailAccounts','mapKeys','prototype','mergeFromDatabase','hasOwnProperty','length','isUndefined','merge','../model/mailAccount'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x8970,0xb3));var _0x0897=function(_0x5948f6,_0x4719ea){_0x5948f6=_0x5948f6-0x0;var _0x314de6=_0x8970[_0x5948f6];return _0x314de6;};'use strict';var _=require('lodash');var MailAccount=require(_0x0897('0x0'));var Realtime=function(){this[_0x0897('0x1')]={};};function freeIsNotKey(_0x40cc25,_0x2bb216,_0xa095d6){var _0x3f7092=_[_0x0897('0x2')](_0x40cc25,function(_0x4f051e,_0x334bd4){return _0x4f051e[_0xa095d6];});for(var _0xb82f85 in _0x2bb216){if(_0x2bb216['hasOwnProperty'](_0xb82f85)){if(!_0x3f7092[_0xb82f85]){delete _0x2bb216[_0xb82f85];}}}}Realtime[_0x0897('0x3')][_0x0897('0x4')]=function(_0x498228,_0x5303bd){for(var _0x518634 in _0x5303bd){if(_0x498228[_0x0897('0x5')](_0x518634)){_0x498228[_0x518634]=_0x5303bd[_0x518634];}}};Realtime[_0x0897('0x3')]['initMailAccounts']=function(){var _0x4c59b8=this;return function(_0x2469b4){if(_0x2469b4){freeIsNotKey(_0x2469b4,_0x4c59b8[_0x0897('0x1')],'id');for(var _0x1b61fe=0x0,_0x3ebba5={},_0x4106be={};_0x1b61fe<_0x2469b4[_0x0897('0x6')];_0x1b61fe+=0x1){_0x3ebba5=_0x2469b4[_0x1b61fe];if(_[_0x0897('0x7')](_0x4c59b8[_0x0897('0x1')][_0x3ebba5['id']])){_0x4c59b8[_0x0897('0x1')][_0x3ebba5['id']]=new MailAccount(_0x3ebba5);}else{_[_0x0897('0x8')](_0x4c59b8[_0x0897('0x1')][_0x3ebba5['id']],_0x3ebba5);}}}return _0x4c59b8['mailAccounts'];};};module['exports']=Realtime;