d098b26f9760d1e334bc9dcca5d3a97934083f2e
[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 _0x9601=['hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys'];(function(_0x2312fd,_0x7712d8){var _0x27acc9=function(_0x17a1d6){while(--_0x17a1d6){_0x2312fd['push'](_0x2312fd['shift']());}};_0x27acc9(++_0x7712d8);}(_0x9601,0x104));var _0x1960=function(_0xf76062,_0x159e1f){_0xf76062=_0xf76062-0x0;var _0x404d7a=_0x9601[_0xf76062];return _0x404d7a;};'use strict';var _=require(_0x1960('0x0'));var MailAccount=require(_0x1960('0x1'));var Realtime=function(){this[_0x1960('0x2')]={};};function freeIsNotKey(_0x460102,_0xa18ceb,_0x1edc71){var _0xf765c=_[_0x1960('0x3')](_0x460102,function(_0x3350f3,_0x41e4cd){return _0x3350f3[_0x1edc71];});for(var _0x5be9f2 in _0xa18ceb){if(_0xa18ceb[_0x1960('0x4')](_0x5be9f2)){if(!_0xf765c[_0x5be9f2]){delete _0xa18ceb[_0x5be9f2];}}}}Realtime[_0x1960('0x5')][_0x1960('0x6')]=function(_0x1f5a59,_0x5ac150){for(var _0x344c41 in _0x5ac150){if(_0x1f5a59['hasOwnProperty'](_0x344c41)){_0x1f5a59[_0x344c41]=_0x5ac150[_0x344c41];}}};Realtime[_0x1960('0x5')][_0x1960('0x7')]=function(){var _0x2590f5=this;return function(_0xec9c80){if(_0xec9c80){freeIsNotKey(_0xec9c80,_0x2590f5[_0x1960('0x2')],'id');for(var _0x27f6f7=0x0,_0x5562fc={},_0x498a33={};_0x27f6f7<_0xec9c80[_0x1960('0x8')];_0x27f6f7+=0x1){_0x5562fc=_0xec9c80[_0x27f6f7];if(_[_0x1960('0x9')](_0x2590f5['mailAccounts'][_0x5562fc['id']])){_0x2590f5[_0x1960('0x2')][_0x5562fc['id']]=new MailAccount(_0x5562fc);}else{_[_0x1960('0xa')](_0x2590f5[_0x1960('0x2')][_0x5562fc['id']],_0x5562fc);}}}return _0x2590f5['mailAccounts'];};};module[_0x1960('0xb')]=Realtime;