Built motion from commit 5ad77b03.|2.6.3
[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 _0xd963=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','WhatsappQueue'];(function(_0x3afe28,_0x17b9f4){var _0x3f5319=function(_0x37ceac){while(--_0x37ceac){_0x3afe28['push'](_0x3afe28['shift']());}};_0x3f5319(++_0x17b9f4);}(_0xd963,0xbc));var _0x3d96=function(_0x192b1c,_0x2d6f00){_0x192b1c=_0x192b1c-0x0;var _0x3c102f=_0xd963[_0x192b1c];return _0x3c102f;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require('../../mysqldb')['db'][_0x3d96('0x0')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x3d96('0x1')](0x0);var events={'afterCreate':_0x3d96('0x2'),'afterUpdate':_0x3d96('0x3'),'afterDestroy':_0x3d96('0x4')};function emitEvent(_0x4e64b9){return function(_0x1fbcbd,_0x56abf2,_0x534fe0){WhatsappQueueEvents[_0x3d96('0x5')](_0x4e64b9+':'+_0x1fbcbd['id'],_0x1fbcbd);WhatsappQueueEvents[_0x3d96('0x5')](_0x4e64b9,_0x1fbcbd);_0x534fe0(null);};}for(var e in events){if(events[_0x3d96('0x6')](e)){var event=events[e];WhatsappQueue[_0x3d96('0x7')](e,emitEvent(event));}}module[_0x3d96('0x8')]=WhatsappQueueEvents;