Built motion from commit 9d0783e6.|2.6.13
[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 _0xaaf1=['emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappQueue','save','update','remove'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xaaf1,0x109));var _0x1aaf=function(_0x24d474,_0xdf655e){_0x24d474=_0x24d474-0x0;var _0x5a3b8e=_0xaaf1[_0x24d474];return _0x5a3b8e;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x1aaf('0x0'))['db'][_0x1aaf('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1aaf('0x2'),'afterUpdate':_0x1aaf('0x3'),'afterDestroy':_0x1aaf('0x4')};function emitEvent(_0x49f0fe){return function(_0x1d3ae6,_0x539699,_0x514d7c){WhatsappQueueEvents[_0x1aaf('0x5')](_0x49f0fe+':'+_0x1d3ae6['id'],_0x1d3ae6);WhatsappQueueEvents['emit'](_0x49f0fe,_0x1d3ae6);_0x514d7c(null);};}for(var e in events){if(events[_0x1aaf('0x6')](e)){var event=events[e];WhatsappQueue[_0x1aaf('0x7')](e,emitEvent(event));}}module[_0x1aaf('0x8')]=WhatsappQueueEvents;