Built motion from commit f3da74b7.|2.5.36
[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 _0xc739=['WhatsappQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x500a5a,_0x3bbd8d){var _0x531a11=function(_0x2905a1){while(--_0x2905a1){_0x500a5a['push'](_0x500a5a['shift']());}};_0x531a11(++_0x3bbd8d);}(_0xc739,0x1ad));var _0x9c73=function(_0x427306,_0x203ab4){_0x427306=_0x427306-0x0;var _0x108fde=_0xc739[_0x427306];return _0x108fde;};'use strict';var EventEmitter=require(_0x9c73('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x9c73('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x9c73('0x2')](0x0);var events={'afterCreate':_0x9c73('0x3'),'afterUpdate':_0x9c73('0x4'),'afterDestroy':_0x9c73('0x5')};function emitEvent(_0xa1e55a){return function(_0xc63044,_0x5599d1,_0x2fa034){WhatsappQueueEvents[_0x9c73('0x6')](_0xa1e55a+':'+_0xc63044['id'],_0xc63044);WhatsappQueueEvents['emit'](_0xa1e55a,_0xc63044);_0x2fa034(null);};}for(var e in events){if(events[_0x9c73('0x7')](e)){var event=events[e];WhatsappQueue[_0x9c73('0x8')](e,emitEvent(event));}}module[_0x9c73('0x9')]=WhatsappQueueEvents;