Built motion from commit (unavailable).|2.5.4
[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 _0x02a6=['update','remove','emit','hook','exports','events','setMaxListeners'];(function(_0x478884,_0x4cf295){var _0x46f443=function(_0x318ba3){while(--_0x318ba3){_0x478884['push'](_0x478884['shift']());}};_0x46f443(++_0x4cf295);}(_0x02a6,0x10f));var _0x602a=function(_0x5aac6d,_0x5b5f50){_0x5aac6d=_0x5aac6d-0x0;var _0x45d9ff=_0x02a6[_0x5aac6d];return _0x45d9ff;};'use strict';var EventEmitter=require(_0x602a('0x0'));var WhatsappQueue=require('../../mysqldb')['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x602a('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x602a('0x2'),'afterDestroy':_0x602a('0x3')};function emitEvent(_0x5c5fd9){return function(_0x3edd7f,_0x39e8b8,_0x1756e0){WhatsappQueueEvents[_0x602a('0x4')](_0x5c5fd9+':'+_0x3edd7f['id'],_0x3edd7f);WhatsappQueueEvents['emit'](_0x5c5fd9,_0x3edd7f);_0x1756e0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x602a('0x5')](e,emitEvent(event));}}module[_0x602a('0x6')]=WhatsappQueueEvents;