Built motion from commit e6806ed6.|2.6.0
[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 _0xea1d=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','MailAccount','setMaxListeners','save'];(function(_0x73d9df,_0x57b204){var _0x4ea984=function(_0x3d8d65){while(--_0x3d8d65){_0x73d9df['push'](_0x73d9df['shift']());}};_0x4ea984(++_0x57b204);}(_0xea1d,0x1d1));var _0xdea1=function(_0x29f067,_0x57a1a7){_0x29f067=_0x29f067-0x0;var _0x3a6f28=_0xea1d[_0x29f067];return _0x3a6f28;};'use strict';var EventEmitter=require(_0xdea1('0x0'));var MailAccount=require(_0xdea1('0x1'))['db'][_0xdea1('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xdea1('0x3')](0x0);var events={'afterCreate':_0xdea1('0x4'),'afterUpdate':_0xdea1('0x5'),'afterDestroy':_0xdea1('0x6')};function emitEvent(_0x1a0083){return function(_0xaf24da,_0x2c226d,_0x80cfc8){MailAccountEvents[_0xdea1('0x7')](_0x1a0083+':'+_0xaf24da['id'],_0xaf24da);MailAccountEvents[_0xdea1('0x7')](_0x1a0083,_0xaf24da);_0x80cfc8(null);};}for(var e in events){if(events[_0xdea1('0x8')](e)){var event=events[e];MailAccount[_0xdea1('0x9')](e,emitEvent(event));}}module['exports']=MailAccountEvents;