Built motion from commit (unavailable).|2.5.10
[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 _0x3dc4=['emit','hook','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove'];(function(_0x11e4a9,_0x5bc08a){var _0x1e8644=function(_0x3ced85){while(--_0x3ced85){_0x11e4a9['push'](_0x11e4a9['shift']());}};_0x1e8644(++_0x5bc08a);}(_0x3dc4,0x17f));var _0x43dc=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x3dc4[_0x3ab51d];return _0x29a04e;};'use strict';var EventEmitter=require(_0x43dc('0x0'));var WhatsappQueue=require(_0x43dc('0x1'))['db'][_0x43dc('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x43dc('0x3')](0x0);var events={'afterCreate':_0x43dc('0x4'),'afterUpdate':_0x43dc('0x5'),'afterDestroy':_0x43dc('0x6')};function emitEvent(_0x24180b){return function(_0x13563f,_0x4b9aba,_0x57fe86){WhatsappQueueEvents[_0x43dc('0x7')](_0x24180b+':'+_0x13563f['id'],_0x13563f);WhatsappQueueEvents[_0x43dc('0x7')](_0x24180b,_0x13563f);_0x57fe86(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x43dc('0x8')](e,emitEvent(event));}}module[_0x43dc('0x9')]=WhatsappQueueEvents;