Built motion from commit bab6f49e.|2.6.17
[motion2.git] / server / api / faxMessage / faxMessage.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 _0x6faf=['FaxMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x2d8629,_0x392da1){var _0xf9d565=function(_0x5317cf){while(--_0x5317cf){_0x2d8629['push'](_0x2d8629['shift']());}};_0xf9d565(++_0x392da1);}(_0x6faf,0xf9));var _0xf6fa=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6faf[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0xf6fa('0x0'))['db'][_0xf6fa('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xf6fa('0x2')](0x0);var events={'afterCreate':_0xf6fa('0x3'),'afterUpdate':_0xf6fa('0x4'),'afterDestroy':_0xf6fa('0x5')};function emitEvent(_0x4f1f7a){return function(_0x243626,_0x4c2fda,_0xed8c6b){FaxMessageEvents['emit'](_0x4f1f7a+':'+_0x243626['id'],_0x243626);FaxMessageEvents[_0xf6fa('0x6')](_0x4f1f7a,_0x243626);_0xed8c6b(null);};}for(var e in events){if(events[_0xf6fa('0x7')](e)){var event=events[e];FaxMessage[_0xf6fa('0x8')](e,emitEvent(event));}}module[_0xf6fa('0x9')]=FaxMessageEvents;