Built motion from commit (unavailable).|2.5.23
[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 _0xfba2=['../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xfba2,0x1c1));var _0x2fba=function(_0x1a84e9,_0x15768d){_0x1a84e9=_0x1a84e9-0x0;var _0x18880e=_0xfba2[_0x1a84e9];return _0x18880e;};'use strict';var EventEmitter=require(_0x2fba('0x0'));var WhatsappQueue=require(_0x2fba('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x2fba('0x2')](0x0);var events={'afterCreate':_0x2fba('0x3'),'afterUpdate':'update','afterDestroy':_0x2fba('0x4')};function emitEvent(_0x3f9716){return function(_0x5ee9b0,_0x38c645,_0x4edf66){WhatsappQueueEvents[_0x2fba('0x5')](_0x3f9716+':'+_0x5ee9b0['id'],_0x5ee9b0);WhatsappQueueEvents[_0x2fba('0x5')](_0x3f9716,_0x5ee9b0);_0x4edf66(null);};}for(var e in events){if(events[_0x2fba('0x6')](e)){var event=events[e];WhatsappQueue[_0x2fba('0x7')](e,emitEvent(event));}}module[_0x2fba('0x8')]=WhatsappQueueEvents;