Built motion from commit ddca4d0d.|2.5.47
[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 _0xebff=['../model/mailAccount','mapKeys','prototype','mergeFromDatabase','initMailAccounts','mailAccounts','length','isUndefined','exports','lodash'];(function(_0x1bc604,_0xe84f9d){var _0x39104b=function(_0x32a839){while(--_0x32a839){_0x1bc604['push'](_0x1bc604['shift']());}};_0x39104b(++_0xe84f9d);}(_0xebff,0x135));var _0xfebf=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xebff[_0x500419];return _0x241c1a;};'use strict';var _=require(_0xfebf('0x0'));var MailAccount=require(_0xfebf('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x12a0f3,_0x59b32d,_0x34f830){var _0x5b0a1c=_[_0xfebf('0x2')](_0x12a0f3,function(_0x1e3e6d,_0x1598ce){return _0x1e3e6d[_0x34f830];});for(var _0x551bec in _0x59b32d){if(_0x59b32d['hasOwnProperty'](_0x551bec)){if(!_0x5b0a1c[_0x551bec]){delete _0x59b32d[_0x551bec];}}}}Realtime[_0xfebf('0x3')][_0xfebf('0x4')]=function(_0x4172c0,_0x92ecbc){for(var _0x554459 in _0x92ecbc){if(_0x4172c0['hasOwnProperty'](_0x554459)){_0x4172c0[_0x554459]=_0x92ecbc[_0x554459];}}};Realtime[_0xfebf('0x3')][_0xfebf('0x5')]=function(){var _0x1529d8=this;return function(_0x22919c){if(_0x22919c){freeIsNotKey(_0x22919c,_0x1529d8[_0xfebf('0x6')],'id');for(var _0x1d3f33=0x0,_0x206fed={},_0x3ab4f8={};_0x1d3f33<_0x22919c[_0xfebf('0x7')];_0x1d3f33+=0x1){_0x206fed=_0x22919c[_0x1d3f33];if(_[_0xfebf('0x8')](_0x1529d8[_0xfebf('0x6')][_0x206fed['id']])){_0x1529d8['mailAccounts'][_0x206fed['id']]=new MailAccount(_0x206fed);}else{_['merge'](_0x1529d8[_0xfebf('0x6')][_0x206fed['id']],_0x206fed);}}}return _0x1529d8['mailAccounts'];};};module[_0xfebf('0x9')]=Realtime;