Built motion from commit d1eab355.|2.6.28
[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 _0x0f03=['hasOwnProperty','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove','emit'];(function(_0x2530cd,_0x2eac9c){var _0xade4fd=function(_0x219570){while(--_0x219570){_0x2530cd['push'](_0x2530cd['shift']());}};_0xade4fd(++_0x2eac9c);}(_0x0f03,0x7a));var _0x30f0=function(_0x42d85f,_0x361752){_0x42d85f=_0x42d85f-0x0;var _0x39fb23=_0x0f03[_0x42d85f];return _0x39fb23;};'use strict';var EventEmitter=require(_0x30f0('0x0'));var WhatsappQueue=require(_0x30f0('0x1'))['db'][_0x30f0('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x30f0('0x3')](0x0);var events={'afterCreate':_0x30f0('0x4'),'afterUpdate':_0x30f0('0x5'),'afterDestroy':_0x30f0('0x6')};function emitEvent(_0xcb46cb){return function(_0x21f426,_0x3e9b4a,_0x942fe4){WhatsappQueueEvents[_0x30f0('0x7')](_0xcb46cb+':'+_0x21f426['id'],_0x21f426);WhatsappQueueEvents[_0x30f0('0x7')](_0xcb46cb,_0x21f426);_0x942fe4(null);};}for(var e in events){if(events[_0x30f0('0x8')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x30f0('0x9')]=WhatsappQueueEvents;