1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0x14d8=['events','../../mysqldb','MailAccount','setMaxListeners','save','update','emit','hasOwnProperty','exports'];(function(_0x35cbed,_0x369b7e){var _0x27017d=function(_0x3da84c){while(--_0x3da84c){_0x35cbed['push'](_0x35cbed['shift']());}};_0x27017d(++_0x369b7e);}(_0x14d8,0x87));var _0x814d=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x14d8[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require(_0x814d('0x0'));var MailAccount=require(_0x814d('0x1'))['db'][_0x814d('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x814d('0x3')](0x0);var events={'afterCreate':_0x814d('0x4'),'afterUpdate':_0x814d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x713ad6){return function(_0x5635f8,_0x4a139a,_0x5268a9){MailAccountEvents[_0x814d('0x6')](_0x713ad6+':'+_0x5635f8['id'],_0x5635f8);MailAccountEvents[_0x814d('0x6')](_0x713ad6,_0x5635f8);_0x5268a9(null);};}for(var e in events){if(events[_0x814d('0x7')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x814d('0x8')]=MailAccountEvents;