Built motion from commit (unavailable).|2.5.30
[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 _0xe7c5=['setMaxListeners','save','update','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x5b5b46,_0x2f94d4){var _0xb985b9=function(_0x5456a4){while(--_0x5456a4){_0x5b5b46['push'](_0x5b5b46['shift']());}};_0xb985b9(++_0x2f94d4);}(_0xe7c5,0x18e));var _0x5e7c=function(_0x38c3f3,_0x544c71){_0x38c3f3=_0x38c3f3-0x0;var _0x285b99=_0xe7c5[_0x38c3f3];return _0x285b99;};'use strict';var EventEmitter=require(_0x5e7c('0x0'));var WhatsappQueue=require(_0x5e7c('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x5e7c('0x2')](0x0);var events={'afterCreate':_0x5e7c('0x3'),'afterUpdate':_0x5e7c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2e1046){return function(_0x3abea9,_0x40e13e,_0x75ae8a){WhatsappQueueEvents[_0x5e7c('0x5')](_0x2e1046+':'+_0x3abea9['id'],_0x3abea9);WhatsappQueueEvents['emit'](_0x2e1046,_0x3abea9);_0x75ae8a(null);};}for(var e in events){if(events[_0x5e7c('0x6')](e)){var event=events[e];WhatsappQueue[_0x5e7c('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;