Built motion from commit ae138b72.|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 _0x5b8b=['WhatsappQueue','save','update','remove','emit','hook','events'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x5b8b,0xe6));var _0xb5b8=function(_0x582421,_0xe8d453){_0x582421=_0x582421-0x0;var _0x37d703=_0x5b8b[_0x582421];return _0x37d703;};'use strict';var EventEmitter=require(_0xb5b8('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0xb5b8('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb5b8('0x2'),'afterUpdate':_0xb5b8('0x3'),'afterDestroy':_0xb5b8('0x4')};function emitEvent(_0x3aef95){return function(_0x4bb6c7,_0x556c51,_0x42afe0){WhatsappQueueEvents[_0xb5b8('0x5')](_0x3aef95+':'+_0x4bb6c7['id'],_0x4bb6c7);WhatsappQueueEvents[_0xb5b8('0x5')](_0x3aef95,_0x4bb6c7);_0x42afe0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xb5b8('0x6')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;