Built motion from commit (unavailable).|2.5.31
[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 _0x09fe=['hasOwnProperty','prototype','mergeFromDatabase','isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0x09fe,0x128));var _0xe09f=function(_0x3ac9dc,_0x32ce88){_0x3ac9dc=_0x3ac9dc-0x0;var _0x36a20d=_0x09fe[_0x3ac9dc];return _0x36a20d;};'use strict';var _=require(_0xe09f('0x0'));var MailAccount=require(_0xe09f('0x1'));var Realtime=function(){this[_0xe09f('0x2')]={};};function freeIsNotKey(_0x4c42b7,_0x2a4c99,_0x5547ce){var _0x1bc288=_[_0xe09f('0x3')](_0x4c42b7,function(_0x1e3231,_0x2e7ec0){return _0x1e3231[_0x5547ce];});for(var _0x5cf5f3 in _0x2a4c99){if(_0x2a4c99[_0xe09f('0x4')](_0x5cf5f3)){if(!_0x1bc288[_0x5cf5f3]){delete _0x2a4c99[_0x5cf5f3];}}}}Realtime[_0xe09f('0x5')][_0xe09f('0x6')]=function(_0x164f2e,_0x4279a0){for(var _0x189e23 in _0x4279a0){if(_0x164f2e['hasOwnProperty'](_0x189e23)){_0x164f2e[_0x189e23]=_0x4279a0[_0x189e23];}}};Realtime[_0xe09f('0x5')]['initMailAccounts']=function(){var _0x2bdc54=this;return function(_0x18b805){if(_0x18b805){freeIsNotKey(_0x18b805,_0x2bdc54[_0xe09f('0x2')],'id');for(var _0x174655=0x0,_0x11a757={},_0x17b34d={};_0x174655<_0x18b805['length'];_0x174655+=0x1){_0x11a757=_0x18b805[_0x174655];if(_[_0xe09f('0x7')](_0x2bdc54[_0xe09f('0x2')][_0x11a757['id']])){_0x2bdc54[_0xe09f('0x2')][_0x11a757['id']]=new MailAccount(_0x11a757);}else{_[_0xe09f('0x8')](_0x2bdc54[_0xe09f('0x2')][_0x11a757['id']],_0x11a757);}}}return _0x2bdc54['mailAccounts'];};};module[_0xe09f('0x9')]=Realtime;