Built motion from commit bab6f49e.|2.6.17
[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 _0xc132=['MailAccount','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x46b1ad,_0x10737a){var _0x5b8532=function(_0x167dbe){while(--_0x167dbe){_0x46b1ad['push'](_0x46b1ad['shift']());}};_0x5b8532(++_0x10737a);}(_0xc132,0x11e));var _0x2c13=function(_0x2cc3e4,_0x1f834a){_0x2cc3e4=_0x2cc3e4-0x0;var _0x45c384=_0xc132[_0x2cc3e4];return _0x45c384;};'use strict';var EventEmitter=require(_0x2c13('0x0'));var MailAccount=require(_0x2c13('0x1'))['db'][_0x2c13('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2c13('0x3'),'afterDestroy':_0x2c13('0x4')};function emitEvent(_0x5c1ea0){return function(_0x30151b,_0x58125a,_0x22d73e){MailAccountEvents[_0x2c13('0x5')](_0x5c1ea0+':'+_0x30151b['id'],_0x30151b);MailAccountEvents[_0x2c13('0x5')](_0x5c1ea0,_0x30151b);_0x22d73e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x2c13('0x6')](e,emitEvent(event));}}module[_0x2c13('0x7')]=MailAccountEvents;