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 _0xc247=['hook','exports','events','../../mysqldb','MailAccount','save','update','emit','hasOwnProperty'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xc247,0xfe));var _0x7c24=function(_0x17c483,_0xc69535){_0x17c483=_0x17c483-0x0;var _0x112bdb=_0xc247[_0x17c483];return _0x112bdb;};'use strict';var EventEmitter=require(_0x7c24('0x0'));var MailAccount=require(_0x7c24('0x1'))['db'][_0x7c24('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7c24('0x3'),'afterUpdate':_0x7c24('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4cdd47){return function(_0x992ba3,_0x2b6046,_0x2b6984){MailAccountEvents[_0x7c24('0x5')](_0x4cdd47+':'+_0x992ba3['id'],_0x992ba3);MailAccountEvents[_0x7c24('0x5')](_0x4cdd47,_0x992ba3);_0x2b6984(null);};}for(var e in events){if(events[_0x7c24('0x6')](e)){var event=events[e];MailAccount[_0x7c24('0x7')](e,emitEvent(event));}}module[_0x7c24('0x8')]=MailAccountEvents;