Built motion from commit 5b761a7b.|2.5.36
[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 _0x1a2c=['WhatsappQueue','setMaxListeners','remove','emit','events','../../mysqldb'];(function(_0x342e0f,_0x4349c9){var _0x1f1b88=function(_0x528b55){while(--_0x528b55){_0x342e0f['push'](_0x342e0f['shift']());}};_0x1f1b88(++_0x4349c9);}(_0x1a2c,0x1b4));var _0xc1a2=function(_0x397442,_0x4e13d6){_0x397442=_0x397442-0x0;var _0x4be4e5=_0x1a2c[_0x397442];return _0x4be4e5;};'use strict';var EventEmitter=require(_0xc1a2('0x0'));var WhatsappQueue=require(_0xc1a2('0x1'))['db'][_0xc1a2('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xc1a2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc1a2('0x4')};function emitEvent(_0x2d0a22){return function(_0x3e9ba2,_0x5a971c,_0x9d35f7){WhatsappQueueEvents[_0xc1a2('0x5')](_0x2d0a22+':'+_0x3e9ba2['id'],_0x3e9ba2);WhatsappQueueEvents[_0xc1a2('0x5')](_0x2d0a22,_0x3e9ba2);_0x9d35f7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;