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 _0xf715=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x1b9c27,_0x126fd0){var _0x34d9c3=function(_0x4c1697){while(--_0x4c1697){_0x1b9c27['push'](_0x1b9c27['shift']());}};_0x34d9c3(++_0x126fd0);}(_0xf715,0x90));var _0x5f71=function(_0x211f91,_0x36b57d){_0x211f91=_0x211f91-0x0;var _0x3f3e3c=_0xf715[_0x211f91];return _0x3f3e3c;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x5f71('0x0'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x5f71('0x1')](0x0);var events={'afterCreate':_0x5f71('0x2'),'afterUpdate':_0x5f71('0x3'),'afterDestroy':_0x5f71('0x4')};function emitEvent(_0x1c8cd2){return function(_0x2fce69,_0x56d0eb,_0x46e3b9){MailAccountEvents[_0x5f71('0x5')](_0x1c8cd2+':'+_0x2fce69['id'],_0x2fce69);MailAccountEvents[_0x5f71('0x5')](_0x1c8cd2,_0x2fce69);_0x46e3b9(null);};}for(var e in events){if(events[_0x5f71('0x6')](e)){var event=events[e];MailAccount[_0x5f71('0x7')](e,emitEvent(event));}}module['exports']=MailAccountEvents;