Built motion from commit 97153652.|2.6.26
[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 _0x3264=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappQueue','setMaxListeners','save'];(function(_0x5a554a,_0x55b05a){var _0x46920e=function(_0x37b9df){while(--_0x37b9df){_0x5a554a['push'](_0x5a554a['shift']());}};_0x46920e(++_0x55b05a);}(_0x3264,0x114));var _0x4326=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x3264[_0x5f1391];return _0x50ebe3;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x4326('0x0'))['db'][_0x4326('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x4326('0x2')](0x0);var events={'afterCreate':_0x4326('0x3'),'afterUpdate':_0x4326('0x4'),'afterDestroy':_0x4326('0x5')};function emitEvent(_0x116bc0){return function(_0x25ec5a,_0x49a08c,_0x4c629c){WhatsappQueueEvents[_0x4326('0x6')](_0x116bc0+':'+_0x25ec5a['id'],_0x25ec5a);WhatsappQueueEvents[_0x4326('0x6')](_0x116bc0,_0x25ec5a);_0x4c629c(null);};}for(var e in events){if(events[_0x4326('0x7')](e)){var event=events[e];WhatsappQueue[_0x4326('0x8')](e,emitEvent(event));}}module[_0x4326('0x9')]=WhatsappQueueEvents;