8db7424500b7c3d956d42ccf99da5861cb40b8ef
[motion2.git] / server / api / mailAccount / mailAccount.events.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
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.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xdafe=['hook','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x4b89d9,_0x3a4a59){var _0x5648ac=function(_0x247968){while(--_0x247968){_0x4b89d9['push'](_0x4b89d9['shift']());}};_0x5648ac(++_0x3a4a59);}(_0xdafe,0xc1));var _0xedaf=function(_0x42058e,_0x38c627){_0x42058e=_0x42058e-0x0;var _0x2dc1f8=_0xdafe[_0x42058e];return _0x2dc1f8;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0xedaf('0x0'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xedaf('0x1')](0x0);var events={'afterCreate':_0xedaf('0x2'),'afterUpdate':'update','afterDestroy':_0xedaf('0x3')};function emitEvent(_0x134b12){return function(_0x556171,_0x146d15,_0x37bec6){MailAccountEvents[_0xedaf('0x4')](_0x134b12+':'+_0x556171['id'],_0x556171);MailAccountEvents[_0xedaf('0x4')](_0x134b12,_0x556171);_0x37bec6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0xedaf('0x5')](e,emitEvent(event));}}module['exports']=MailAccountEvents;