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 _0xf228=['hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x53cc19,_0x5511b2){var _0x4a9ba1=function(_0xfe7ced){while(--_0xfe7ced){_0x53cc19['push'](_0x53cc19['shift']());}};_0x4a9ba1(++_0x5511b2);}(_0xf228,0x1a9));var _0x8f22=function(_0x48ac18,_0x295a92){_0x48ac18=_0x48ac18-0x0;var _0x3914cf=_0xf228[_0x48ac18];return _0x3914cf;};'use strict';var EventEmitter=require(_0x8f22('0x0'));var MailAccount=require(_0x8f22('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x8f22('0x2')](0x0);var events={'afterCreate':_0x8f22('0x3'),'afterUpdate':_0x8f22('0x4'),'afterDestroy':_0x8f22('0x5')};function emitEvent(_0x1d7f24){return function(_0x134ed2,_0x569710,_0x51b03f){MailAccountEvents[_0x8f22('0x6')](_0x1d7f24+':'+_0x134ed2['id'],_0x134ed2);MailAccountEvents['emit'](_0x1d7f24,_0x134ed2);_0x51b03f(null);};}for(var e in events){if(events[_0x8f22('0x7')](e)){var event=events[e];MailAccount[_0x8f22('0x8')](e,emitEvent(event));}}module['exports']=MailAccountEvents;