Built motion from commit (unavailable).|2.4.18
[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 _0xc3c8=['../model/mailAccount','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','mailAccounts','merge'];(function(_0x1c55f1,_0x3669ca){var _0x44dd27=function(_0x531d3e){while(--_0x531d3e){_0x1c55f1['push'](_0x1c55f1['shift']());}};_0x44dd27(++_0x3669ca);}(_0xc3c8,0x180));var _0x8c3c=function(_0x3c2947,_0x473f08){_0x3c2947=_0x3c2947-0x0;var _0x360ab3=_0xc3c8[_0x3c2947];return _0x360ab3;};'use strict';var _=require('lodash');var MailAccount=require(_0x8c3c('0x0'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x2ba29c,_0x3675eb,_0x59ff8a){var _0x404ce5=_[_0x8c3c('0x1')](_0x2ba29c,function(_0x2c1875,_0x5b1365){return _0x2c1875[_0x59ff8a];});for(var _0x3c1a53 in _0x3675eb){if(_0x3675eb[_0x8c3c('0x2')](_0x3c1a53)){if(!_0x404ce5[_0x3c1a53]){delete _0x3675eb[_0x3c1a53];}}}}Realtime[_0x8c3c('0x3')][_0x8c3c('0x4')]=function(_0x552106,_0xd031e){for(var _0x5c7703 in _0xd031e){if(_0x552106[_0x8c3c('0x2')](_0x5c7703)){_0x552106[_0x5c7703]=_0xd031e[_0x5c7703];}}};Realtime[_0x8c3c('0x3')][_0x8c3c('0x5')]=function(){var _0x3111ab=this;return function(_0x3d5d66){if(_0x3d5d66){freeIsNotKey(_0x3d5d66,_0x3111ab[_0x8c3c('0x6')],'id');for(var _0x84c78a=0x0,_0x52fc2c={},_0x1a77d3={};_0x84c78a<_0x3d5d66['length'];_0x84c78a+=0x1){_0x52fc2c=_0x3d5d66[_0x84c78a];if(_['isUndefined'](_0x3111ab['mailAccounts'][_0x52fc2c['id']])){_0x3111ab[_0x8c3c('0x6')][_0x52fc2c['id']]=new MailAccount(_0x52fc2c);}else{_[_0x8c3c('0x7')](_0x3111ab[_0x8c3c('0x6')][_0x52fc2c['id']],_0x52fc2c);}}}return _0x3111ab[_0x8c3c('0x6')];};};module['exports']=Realtime;