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 _0x62f1=['remove','emit','hasOwnProperty','hook','events','MailAccount','setMaxListeners','save','update'];(function(_0x110c54,_0xa3cfcb){var _0x58a348=function(_0x2ddb40){while(--_0x2ddb40){_0x110c54['push'](_0x110c54['shift']());}};_0x58a348(++_0xa3cfcb);}(_0x62f1,0x112));var _0x162f=function(_0x21e97b,_0x65a77f){_0x21e97b=_0x21e97b-0x0;var _0x10ba44=_0x62f1[_0x21e97b];return _0x10ba44;};'use strict';var EventEmitter=require(_0x162f('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x162f('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x162f('0x2')](0x0);var events={'afterCreate':_0x162f('0x3'),'afterUpdate':_0x162f('0x4'),'afterDestroy':_0x162f('0x5')};function emitEvent(_0x364694){return function(_0x36ed0f,_0x223f35,_0xfc0863){MailAccountEvents[_0x162f('0x6')](_0x364694+':'+_0x36ed0f['id'],_0x36ed0f);MailAccountEvents['emit'](_0x364694,_0x36ed0f);_0xfc0863(null);};}for(var e in events){if(events[_0x162f('0x7')](e)){var event=events[e];MailAccount[_0x162f('0x8')](e,emitEvent(event));}}module['exports']=MailAccountEvents;