Built motion from commit bbec7235.|2.6.20
[motion2.git] / server / api / faxQueue / faxQueue.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 _0x170d=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','FaxQueue','setMaxListeners','save'];(function(_0x1b561b,_0x57bc19){var _0x13810e=function(_0x425be0){while(--_0x425be0){_0x1b561b['push'](_0x1b561b['shift']());}};_0x13810e(++_0x57bc19);}(_0x170d,0x69));var _0xd170=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x170d[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0xd170('0x0'));var FaxQueue=require(_0xd170('0x1'))['db'][_0xd170('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xd170('0x3')](0x0);var events={'afterCreate':_0xd170('0x4'),'afterUpdate':_0xd170('0x5'),'afterDestroy':_0xd170('0x6')};function emitEvent(_0x3b1aeb){return function(_0x2f8a2a,_0x42b082,_0x427fb5){FaxQueueEvents['emit'](_0x3b1aeb+':'+_0x2f8a2a['id'],_0x2f8a2a);FaxQueueEvents[_0xd170('0x7')](_0x3b1aeb,_0x2f8a2a);_0x427fb5(null);};}for(var e in events){if(events[_0xd170('0x8')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xd170('0x9')]=FaxQueueEvents;