Built motion from commit 936e8062.|2.5.33
[motion2.git] / server / api / whatsappQueue / whatsappQueue.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 _0xd021=['setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb','WhatsappQueue'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0xd021,0xd5));var _0x1d02=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd021[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x1d02('0x0'));var WhatsappQueue=require(_0x1d02('0x1'))['db'][_0x1d02('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x1d02('0x3')](0x0);var events={'afterCreate':_0x1d02('0x4'),'afterUpdate':_0x1d02('0x5'),'afterDestroy':_0x1d02('0x6')};function emitEvent(_0x291798){return function(_0x34955e,_0xa18c83,_0x4a521e){WhatsappQueueEvents[_0x1d02('0x7')](_0x291798+':'+_0x34955e['id'],_0x34955e);WhatsappQueueEvents['emit'](_0x291798,_0x34955e);_0x4a521e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x1d02('0x8')]=WhatsappQueueEvents;