Built motion from commit (unavailable).|2.5.10
[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 _0xe6b3=['exports','../../mysqldb','setMaxListeners','save','remove','emit','hook'];(function(_0x5c65fc,_0x10e517){var _0x2c9a9e=function(_0x1ec4b2){while(--_0x1ec4b2){_0x5c65fc['push'](_0x5c65fc['shift']());}};_0x2c9a9e(++_0x10e517);}(_0xe6b3,0x94));var _0x3e6b=function(_0x4674e9,_0x5bfaeb){_0x4674e9=_0x4674e9-0x0;var _0x171b46=_0xe6b3[_0x4674e9];return _0x171b46;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x3e6b('0x0'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x3e6b('0x1')](0x0);var events={'afterCreate':_0x3e6b('0x2'),'afterUpdate':'update','afterDestroy':_0x3e6b('0x3')};function emitEvent(_0x442d95){return function(_0x2e491a,_0x232824,_0x440cab){MailAccountEvents['emit'](_0x442d95+':'+_0x2e491a['id'],_0x2e491a);MailAccountEvents[_0x3e6b('0x4')](_0x442d95,_0x2e491a);_0x440cab(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x3e6b('0x5')](e,emitEvent(event));}}module[_0x3e6b('0x6')]=MailAccountEvents;