01d13055d5f4cc92d200a97549545893f1c95e88
[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 _0xe75a=['setMaxListeners','save','emit','exports','events','../../mysqldb'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xe75a,0x12a));var _0xae75=function(_0x28edda,_0xbd447a){_0x28edda=_0x28edda-0x0;var _0x21f4a4=_0xe75a[_0x28edda];return _0x21f4a4;};'use strict';var EventEmitter=require(_0xae75('0x0'));var WhatsappQueue=require(_0xae75('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xae75('0x2')](0x0);var events={'afterCreate':_0xae75('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1d8629){return function(_0x130b25,_0x4c1f83,_0x3b766c){WhatsappQueueEvents[_0xae75('0x4')](_0x1d8629+':'+_0x130b25['id'],_0x130b25);WhatsappQueueEvents[_0xae75('0x4')](_0x1d8629,_0x130b25);_0x3b766c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xae75('0x5')]=WhatsappQueueEvents;