Built motion from commit 10af8726.|2.6.34
[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 _0xc6ac=['setMaxListeners','save','update','emit','hasOwnProperty','events','../../mysqldb','WhatsappQueue'];(function(_0x701b04,_0x38aca0){var _0x2b1c61=function(_0xa60200){while(--_0xa60200){_0x701b04['push'](_0x701b04['shift']());}};_0x2b1c61(++_0x38aca0);}(_0xc6ac,0x195));var _0xcc6a=function(_0x383bd9,_0x3d252c){_0x383bd9=_0x383bd9-0x0;var _0x54d628=_0xc6ac[_0x383bd9];return _0x54d628;};'use strict';var EventEmitter=require(_0xcc6a('0x0'));var WhatsappQueue=require(_0xcc6a('0x1'))['db'][_0xcc6a('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xcc6a('0x3')](0x0);var events={'afterCreate':_0xcc6a('0x4'),'afterUpdate':_0xcc6a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x56307d){return function(_0x171773,_0x5e88e1,_0x17c9c7){WhatsappQueueEvents[_0xcc6a('0x6')](_0x56307d+':'+_0x171773['id'],_0x171773);WhatsappQueueEvents[_0xcc6a('0x6')](_0x56307d,_0x171773);_0x17c9c7(null);};}for(var e in events){if(events[_0xcc6a('0x7')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;