Built motion from commit (unavailable).|2.5.26
[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 _0x96ee=['prototype','mergeFromDatabase','hasOwnProperty','initMailAccounts','mailAccounts','length','isUndefined','merge','exports','lodash','../model/mailAccount','mapKeys'];(function(_0xdac374,_0x30ad46){var _0x5ac031=function(_0x3c06c1){while(--_0x3c06c1){_0xdac374['push'](_0xdac374['shift']());}};_0x5ac031(++_0x30ad46);}(_0x96ee,0x111));var _0xe96e=function(_0xd1b4d7,_0x28b2c1){_0xd1b4d7=_0xd1b4d7-0x0;var _0x3002ec=_0x96ee[_0xd1b4d7];return _0x3002ec;};'use strict';var _=require(_0xe96e('0x0'));var MailAccount=require(_0xe96e('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x88f7c0,_0x3f7c75,_0x71f7ae){var _0x43aae7=_[_0xe96e('0x2')](_0x88f7c0,function(_0x33e934,_0x5fcfea){return _0x33e934[_0x71f7ae];});for(var _0x5c9dce in _0x3f7c75){if(_0x3f7c75['hasOwnProperty'](_0x5c9dce)){if(!_0x43aae7[_0x5c9dce]){delete _0x3f7c75[_0x5c9dce];}}}}Realtime[_0xe96e('0x3')][_0xe96e('0x4')]=function(_0x5720c9,_0x5c3092){for(var _0x4fca03 in _0x5c3092){if(_0x5720c9[_0xe96e('0x5')](_0x4fca03)){_0x5720c9[_0x4fca03]=_0x5c3092[_0x4fca03];}}};Realtime[_0xe96e('0x3')][_0xe96e('0x6')]=function(){var _0x545e4b=this;return function(_0x5cab18){if(_0x5cab18){freeIsNotKey(_0x5cab18,_0x545e4b[_0xe96e('0x7')],'id');for(var _0x40d7c9=0x0,_0x3e740a={},_0x13af0e={};_0x40d7c9<_0x5cab18[_0xe96e('0x8')];_0x40d7c9+=0x1){_0x3e740a=_0x5cab18[_0x40d7c9];if(_[_0xe96e('0x9')](_0x545e4b[_0xe96e('0x7')][_0x3e740a['id']])){_0x545e4b[_0xe96e('0x7')][_0x3e740a['id']]=new MailAccount(_0x3e740a);}else{_[_0xe96e('0xa')](_0x545e4b[_0xe96e('0x7')][_0x3e740a['id']],_0x3e740a);}}}return _0x545e4b[_0xe96e('0x7')];};};module[_0xe96e('0xb')]=Realtime;