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 _0xf28b=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','save','update'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xf28b,0x1f4));var _0xbf28=function(_0x4dde18,_0x931f57){_0x4dde18=_0x4dde18-0x0;var _0x4fd6f2=_0xf28b[_0x4dde18];return _0x4fd6f2;};'use strict';var EventEmitter=require(_0xbf28('0x0'));var MailAccount=require(_0xbf28('0x1'))['db'][_0xbf28('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xbf28('0x3')](0x0);var events={'afterCreate':_0xbf28('0x4'),'afterUpdate':_0xbf28('0x5'),'afterDestroy':_0xbf28('0x6')};function emitEvent(_0x5e4d8d){return function(_0x447efd,_0x480d5b,_0x52a1ad){MailAccountEvents[_0xbf28('0x7')](_0x5e4d8d+':'+_0x447efd['id'],_0x447efd);MailAccountEvents[_0xbf28('0x7')](_0x5e4d8d,_0x447efd);_0x52a1ad(null);};}for(var e in events){if(events[_0xbf28('0x8')](e)){var event=events[e];MailAccount[_0xbf28('0x9')](e,emitEvent(event));}}module[_0xbf28('0xa')]=MailAccountEvents;