Built motion from commit 00bf23f6.|2.6.16
[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 _0xbd18=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappQueue','setMaxListeners','save','update'];(function(_0x280212,_0x16a957){var _0xd39f9e=function(_0x42f234){while(--_0x42f234){_0x280212['push'](_0x280212['shift']());}};_0xd39f9e(++_0x16a957);}(_0xbd18,0x11d));var _0x8bd1=function(_0x224786,_0x4fc240){_0x224786=_0x224786-0x0;var _0x3e348c=_0xbd18[_0x224786];return _0x3e348c;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x8bd1('0x0'))['db'][_0x8bd1('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x8bd1('0x2')](0x0);var events={'afterCreate':_0x8bd1('0x3'),'afterUpdate':_0x8bd1('0x4'),'afterDestroy':_0x8bd1('0x5')};function emitEvent(_0x4f21c2){return function(_0x245527,_0x164114,_0x4d3688){WhatsappQueueEvents[_0x8bd1('0x6')](_0x4f21c2+':'+_0x245527['id'],_0x245527);WhatsappQueueEvents[_0x8bd1('0x6')](_0x4f21c2,_0x245527);_0x4d3688(null);};}for(var e in events){if(events[_0x8bd1('0x7')](e)){var event=events[e];WhatsappQueue[_0x8bd1('0x8')](e,emitEvent(event));}}module[_0x8bd1('0x9')]=WhatsappQueueEvents;