1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0x80ad=['remove','emit','hasOwnProperty','hook','../../mysqldb','WhatsappQueue','save','update'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x80ad,0xbc));var _0xd80a=function(_0xea6c20,_0x5a0de8){_0xea6c20=_0xea6c20-0x0;var _0x458655=_0x80ad[_0xea6c20];return _0x458655;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xd80a('0x0'))['db'][_0xd80a('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd80a('0x2'),'afterUpdate':_0xd80a('0x3'),'afterDestroy':_0xd80a('0x4')};function emitEvent(_0x2e1f43){return function(_0x5f02b8,_0x8a3d82,_0x356e47){WhatsappQueueEvents['emit'](_0x2e1f43+':'+_0x5f02b8['id'],_0x5f02b8);WhatsappQueueEvents[_0xd80a('0x5')](_0x2e1f43,_0x5f02b8);_0x356e47(null);};}for(var e in events){if(events[_0xd80a('0x6')](e)){var event=events[e];WhatsappQueue[_0xd80a('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;