Built motion from commit (unavailable).|2.5.13
[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 _0xf608=['hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','save','update','remove','emit'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf608,0xfd));var _0x8f60=function(_0x76ced3,_0x8abc01){_0x76ced3=_0x76ced3-0x0;var _0x4fea70=_0xf608[_0x76ced3];return _0x4fea70;};'use strict';var EventEmitter=require(_0x8f60('0x0'));var MailAccount=require(_0x8f60('0x1'))['db'][_0x8f60('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8f60('0x3'),'afterUpdate':_0x8f60('0x4'),'afterDestroy':_0x8f60('0x5')};function emitEvent(_0xcf836c){return function(_0x1becf5,_0x2583a6,_0x33bb60){MailAccountEvents[_0x8f60('0x6')](_0xcf836c+':'+_0x1becf5['id'],_0x1becf5);MailAccountEvents[_0x8f60('0x6')](_0xcf836c,_0x1becf5);_0x33bb60(null);};}for(var e in events){if(events[_0x8f60('0x7')](e)){var event=events[e];MailAccount[_0x8f60('0x8')](e,emitEvent(event));}}module[_0x8f60('0x9')]=MailAccountEvents;