Built motion from commit 1ea47bf4.|2.6.34
[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 _0xde88=['WhatsappQueue','setMaxListeners','update','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x4454b2,_0x3f408b){var _0x50b8f1=function(_0x5bdbe8){while(--_0x5bdbe8){_0x4454b2['push'](_0x4454b2['shift']());}};_0x50b8f1(++_0x3f408b);}(_0xde88,0x87));var _0x8de8=function(_0x47623f,_0x148f3a){_0x47623f=_0x47623f-0x0;var _0x282ce8=_0xde88[_0x47623f];return _0x282ce8;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x8de8('0x0'))['db'][_0x8de8('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x8de8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8de8('0x3'),'afterDestroy':_0x8de8('0x4')};function emitEvent(_0x3fbc94){return function(_0x107679,_0x1b21b8,_0x42bab8){WhatsappQueueEvents[_0x8de8('0x5')](_0x3fbc94+':'+_0x107679['id'],_0x107679);WhatsappQueueEvents['emit'](_0x3fbc94,_0x107679);_0x42bab8(null);};}for(var e in events){if(events[_0x8de8('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x8de8('0x7')]=WhatsappQueueEvents;