Built motion from commit 0900f080.|2.5.45
[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 _0xd0b1=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappQueue'];(function(_0x4459b8,_0x3271b8){var _0x4a4b07=function(_0x3075f8){while(--_0x3075f8){_0x4459b8['push'](_0x4459b8['shift']());}};_0x4a4b07(++_0x3271b8);}(_0xd0b1,0x9d));var _0x1d0b=function(_0xc8718c,_0x3a17bb){_0xc8718c=_0xc8718c-0x0;var _0x53b072=_0xd0b1[_0xc8718c];return _0x53b072;};'use strict';var EventEmitter=require(_0x1d0b('0x0'));var WhatsappQueue=require(_0x1d0b('0x1'))['db'][_0x1d0b('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x1d0b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1d0b('0x4'),'afterDestroy':_0x1d0b('0x5')};function emitEvent(_0x4cd1a8){return function(_0x591f5e,_0x314b30,_0x4e5eb5){WhatsappQueueEvents[_0x1d0b('0x6')](_0x4cd1a8+':'+_0x591f5e['id'],_0x591f5e);WhatsappQueueEvents['emit'](_0x4cd1a8,_0x591f5e);_0x4e5eb5(null);};}for(var e in events){if(events[_0x1d0b('0x7')](e)){var event=events[e];WhatsappQueue[_0x1d0b('0x8')](e,emitEvent(event));}}module[_0x1d0b('0x9')]=WhatsappQueueEvents;