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 _0xfb48=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','update','remove'];(function(_0x2ac622,_0x5a31b9){var _0x500fce=function(_0x18b7ef){while(--_0x18b7ef){_0x2ac622['push'](_0x2ac622['shift']());}};_0x500fce(++_0x5a31b9);}(_0xfb48,0x1f4));var _0x8fb4=function(_0x13b666,_0x2c793e){_0x13b666=_0x13b666-0x0;var _0x5b2273=_0xfb48[_0x13b666];return _0x5b2273;};'use strict';var EventEmitter=require(_0x8fb4('0x0'));var WhatsappQueue=require('../../mysqldb')['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x8fb4('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8fb4('0x2'),'afterDestroy':_0x8fb4('0x3')};function emitEvent(_0x7a7f4e){return function(_0x428170,_0x1442b9,_0x316502){WhatsappQueueEvents[_0x8fb4('0x4')](_0x7a7f4e+':'+_0x428170['id'],_0x428170);WhatsappQueueEvents[_0x8fb4('0x4')](_0x7a7f4e,_0x428170);_0x316502(null);};}for(var e in events){if(events[_0x8fb4('0x5')](e)){var event=events[e];WhatsappQueue[_0x8fb4('0x6')](e,emitEvent(event));}}module[_0x8fb4('0x7')]=WhatsappQueueEvents;