Built motion from commit 85328c08.|2.5.50
[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 _0x9ce9=['hook','exports','../../mysqldb','WhatsappQueue','save','update','remove','emit','hasOwnProperty'];(function(_0x29cb4f,_0x26a21d){var _0x51e06d=function(_0x3ce158){while(--_0x3ce158){_0x29cb4f['push'](_0x29cb4f['shift']());}};_0x51e06d(++_0x26a21d);}(_0x9ce9,0x1e8));var _0x99ce=function(_0x4d6f10,_0x1bb9fc){_0x4d6f10=_0x4d6f10-0x0;var _0x251b9c=_0x9ce9[_0x4d6f10];return _0x251b9c;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x99ce('0x0'))['db'][_0x99ce('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x99ce('0x2'),'afterUpdate':_0x99ce('0x3'),'afterDestroy':_0x99ce('0x4')};function emitEvent(_0x8afaf4){return function(_0x5e4282,_0x5170f2,_0x4b9756){WhatsappQueueEvents[_0x99ce('0x5')](_0x8afaf4+':'+_0x5e4282['id'],_0x5e4282);WhatsappQueueEvents[_0x99ce('0x5')](_0x8afaf4,_0x5e4282);_0x4b9756(null);};}for(var e in events){if(events[_0x99ce('0x6')](e)){var event=events[e];WhatsappQueue[_0x99ce('0x7')](e,emitEvent(event));}}module[_0x99ce('0x8')]=WhatsappQueueEvents;