6e7f65de7444076ddac9f04173c43f9923584951
[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 _0xc9c3=['MailAccount','save','update','remove','hook','exports'];(function(_0x49efdb,_0x119710){var _0x33d25d=function(_0x93ff5a){while(--_0x93ff5a){_0x49efdb['push'](_0x49efdb['shift']());}};_0x33d25d(++_0x119710);}(_0xc9c3,0x96));var _0x3c9c=function(_0x6587bf,_0x597e74){_0x6587bf=_0x6587bf-0x0;var _0xe3be91=_0xc9c3[_0x6587bf];return _0xe3be91;};'use strict';var EventEmitter=require('events');var MailAccount=require('../../mysqldb')['db'][_0x3c9c('0x0')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3c9c('0x1'),'afterUpdate':_0x3c9c('0x2'),'afterDestroy':_0x3c9c('0x3')};function emitEvent(_0x2ec103){return function(_0x2b0045,_0xe07e05,_0x143bfe){MailAccountEvents['emit'](_0x2ec103+':'+_0x2b0045['id'],_0x2b0045);MailAccountEvents['emit'](_0x2ec103,_0x2b0045);_0x143bfe(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x3c9c('0x4')](e,emitEvent(event));}}module[_0x3c9c('0x5')]=MailAccountEvents;