Built motion from commit 3e059bc2.|2.5.32
[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 _0xba0d=['setMaxListeners','save','remove','emit','hook','exports','events','MailAccount'];(function(_0x164c73,_0x43e25a){var _0x3953e0=function(_0x29fefd){while(--_0x29fefd){_0x164c73['push'](_0x164c73['shift']());}};_0x3953e0(++_0x43e25a);}(_0xba0d,0x8e));var _0xdba0=function(_0x2b9d29,_0x5aafbf){_0x2b9d29=_0x2b9d29-0x0;var _0x163812=_0xba0d[_0x2b9d29];return _0x163812;};'use strict';var EventEmitter=require(_0xdba0('0x0'));var MailAccount=require('../../mysqldb')['db'][_0xdba0('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xdba0('0x2')](0x0);var events={'afterCreate':_0xdba0('0x3'),'afterUpdate':'update','afterDestroy':_0xdba0('0x4')};function emitEvent(_0x50eadf){return function(_0xebb600,_0x426cac,_0x6a96ad){MailAccountEvents[_0xdba0('0x5')](_0x50eadf+':'+_0xebb600['id'],_0xebb600);MailAccountEvents['emit'](_0x50eadf,_0xebb600);_0x6a96ad(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0xdba0('0x6')](e,emitEvent(event));}}module[_0xdba0('0x7')]=MailAccountEvents;