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 _0xffc8=['../../mysqldb','MailAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xffc8,0xd1));var _0x8ffc=function(_0x54c7d9,_0x110ba1){_0x54c7d9=_0x54c7d9-0x0;var _0x2faa9b=_0xffc8[_0x54c7d9];return _0x2faa9b;};'use strict';var EventEmitter=require(_0x8ffc('0x0'));var MailAccount=require(_0x8ffc('0x1'))['db'][_0x8ffc('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x8ffc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8ffc('0x4'),'afterDestroy':_0x8ffc('0x5')};function emitEvent(_0x5c3de0){return function(_0x24c8d5,_0x46d2a1,_0x132a4e){MailAccountEvents[_0x8ffc('0x6')](_0x5c3de0+':'+_0x24c8d5['id'],_0x24c8d5);MailAccountEvents[_0x8ffc('0x6')](_0x5c3de0,_0x24c8d5);_0x132a4e(null);};}for(var e in events){if(events[_0x8ffc('0x7')](e)){var event=events[e];MailAccount[_0x8ffc('0x8')](e,emitEvent(event));}}module[_0x8ffc('0x9')]=MailAccountEvents;