Built motion from commit da617fac.|2.6.6
[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 _0xa47b=['setMaxListeners','update','remove','emit','hasOwnProperty','exports','../../mysqldb','WhatsappQueue'];(function(_0x2a9c1f,_0x50ff2c){var _0x3af502=function(_0x7f31d2){while(--_0x7f31d2){_0x2a9c1f['push'](_0x2a9c1f['shift']());}};_0x3af502(++_0x50ff2c);}(_0xa47b,0x176));var _0xba47=function(_0x30e7b6,_0x5ebe4d){_0x30e7b6=_0x30e7b6-0x0;var _0x5d9839=_0xa47b[_0x30e7b6];return _0x5d9839;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xba47('0x0'))['db'][_0xba47('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xba47('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xba47('0x3'),'afterDestroy':_0xba47('0x4')};function emitEvent(_0x25c4c1){return function(_0x33033b,_0x3d3cf7,_0x1f4bcf){WhatsappQueueEvents['emit'](_0x25c4c1+':'+_0x33033b['id'],_0x33033b);WhatsappQueueEvents[_0xba47('0x5')](_0x25c4c1,_0x33033b);_0x1f4bcf(null);};}for(var e in events){if(events[_0xba47('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xba47('0x7')]=WhatsappQueueEvents;