Built motion from commit (unavailable).|2.5.14
[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 _0x659a=['setMaxListeners','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x659a,0x1df));var _0xa659=function(_0x2ab76b,_0x176579){_0x2ab76b=_0x2ab76b-0x0;var _0x201126=_0x659a[_0x2ab76b];return _0x201126;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0xa659('0x0'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xa659('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xa659('0x2')};function emitEvent(_0x445608){return function(_0x169eb4,_0x5a3186,_0x2eeb1d){MailAccountEvents[_0xa659('0x3')](_0x445608+':'+_0x169eb4['id'],_0x169eb4);MailAccountEvents[_0xa659('0x3')](_0x445608,_0x169eb4);_0x2eeb1d(null);};}for(var e in events){if(events[_0xa659('0x4')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xa659('0x5')]=MailAccountEvents;