Built motion from commit (unavailable).|2.5.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 _0xccce=['initMailAccounts','mailAccounts','length','isUndefined','merge','../model/mailAccount','mapKeys','hasOwnProperty','prototype','mergeFromDatabase'];(function(_0x4392af,_0xec5afe){var _0x9fa8eb=function(_0x41d7a4){while(--_0x41d7a4){_0x4392af['push'](_0x4392af['shift']());}};_0x9fa8eb(++_0xec5afe);}(_0xccce,0x1d1));var _0xeccc=function(_0x2b5645,_0x1ff5a1){_0x2b5645=_0x2b5645-0x0;var _0x1db6d1=_0xccce[_0x2b5645];return _0x1db6d1;};'use strict';var _=require('lodash');var MailAccount=require(_0xeccc('0x0'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x3ffc1b,_0x48c5ee,_0x191770){var _0x46bacc=_[_0xeccc('0x1')](_0x3ffc1b,function(_0x53920e,_0x5be7a5){return _0x53920e[_0x191770];});for(var _0x1616b9 in _0x48c5ee){if(_0x48c5ee[_0xeccc('0x2')](_0x1616b9)){if(!_0x46bacc[_0x1616b9]){delete _0x48c5ee[_0x1616b9];}}}}Realtime[_0xeccc('0x3')][_0xeccc('0x4')]=function(_0x37c4bc,_0x466550){for(var _0x36b186 in _0x466550){if(_0x37c4bc[_0xeccc('0x2')](_0x36b186)){_0x37c4bc[_0x36b186]=_0x466550[_0x36b186];}}};Realtime[_0xeccc('0x3')][_0xeccc('0x5')]=function(){var _0x50e764=this;return function(_0x304c2f){if(_0x304c2f){freeIsNotKey(_0x304c2f,_0x50e764[_0xeccc('0x6')],'id');for(var _0x828617=0x0,_0x36467f={},_0x20bb08={};_0x828617<_0x304c2f[_0xeccc('0x7')];_0x828617+=0x1){_0x36467f=_0x304c2f[_0x828617];if(_[_0xeccc('0x8')](_0x50e764[_0xeccc('0x6')][_0x36467f['id']])){_0x50e764[_0xeccc('0x6')][_0x36467f['id']]=new MailAccount(_0x36467f);}else{_[_0xeccc('0x9')](_0x50e764['mailAccounts'][_0x36467f['id']],_0x36467f);}}}return _0x50e764[_0xeccc('0x6')];};};module['exports']=Realtime;