Built motion from commit d1eab355.|2.6.28
[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 _0x6c20=['hasOwnProperty','hook','exports','events','../../mysqldb','save','emit'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x6c20,0x88));var _0x06c2=function(_0x275b86,_0x3259a6){_0x275b86=_0x275b86-0x0;var _0x450345=_0x6c20[_0x275b86];return _0x450345;};'use strict';var EventEmitter=require(_0x06c2('0x0'));var MailAccount=require(_0x06c2('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x06c2('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x6beb91){return function(_0xecb676,_0x169412,_0x2c7843){MailAccountEvents[_0x06c2('0x3')](_0x6beb91+':'+_0xecb676['id'],_0xecb676);MailAccountEvents[_0x06c2('0x3')](_0x6beb91,_0xecb676);_0x2c7843(null);};}for(var e in events){if(events[_0x06c2('0x4')](e)){var event=events[e];MailAccount[_0x06c2('0x5')](e,emitEvent(event));}}module[_0x06c2('0x6')]=MailAccountEvents;