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 _0x8bb7=['emit','hasOwnProperty','hook','events','../../mysqldb','MailAccount','setMaxListeners'];(function(_0x3c0944,_0x226337){var _0x6312be=function(_0x56bb5a){while(--_0x56bb5a){_0x3c0944['push'](_0x3c0944['shift']());}};_0x6312be(++_0x226337);}(_0x8bb7,0xf1));var _0x78bb=function(_0xf9163d,_0xc2ff7d){_0xf9163d=_0xf9163d-0x0;var _0x53914e=_0x8bb7[_0xf9163d];return _0x53914e;};'use strict';var EventEmitter=require(_0x78bb('0x0'));var MailAccount=require(_0x78bb('0x1'))['db'][_0x78bb('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x78bb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xed53e4){return function(_0x221a85,_0x12ce28,_0x35e952){MailAccountEvents['emit'](_0xed53e4+':'+_0x221a85['id'],_0x221a85);MailAccountEvents[_0x78bb('0x4')](_0xed53e4,_0x221a85);_0x35e952(null);};}for(var e in events){if(events[_0x78bb('0x5')](e)){var event=events[e];MailAccount[_0x78bb('0x6')](e,emitEvent(event));}}module['exports']=MailAccountEvents;