Built motion from commit 3e059bc2.|2.5.32
[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 _0xd834=['events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x351408,_0x559010){var _0x422630=function(_0x485d00){while(--_0x485d00){_0x351408['push'](_0x351408['shift']());}};_0x422630(++_0x559010);}(_0xd834,0x195));var _0x4d83=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xd834[_0x46698a];return _0x356db0;};'use strict';var EventEmitter=require(_0x4d83('0x0'));var WhatsappQueue=require(_0x4d83('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x4d83('0x2')](0x0);var events={'afterCreate':_0x4d83('0x3'),'afterUpdate':'update','afterDestroy':_0x4d83('0x4')};function emitEvent(_0x5d141b){return function(_0x4f94fc,_0x577383,_0x11b75f){WhatsappQueueEvents['emit'](_0x5d141b+':'+_0x4f94fc['id'],_0x4f94fc);WhatsappQueueEvents[_0x4d83('0x5')](_0x5d141b,_0x4f94fc);_0x11b75f(null);};}for(var e in events){if(events[_0x4d83('0x6')](e)){var event=events[e];WhatsappQueue[_0x4d83('0x7')](e,emitEvent(event));}}module[_0x4d83('0x8')]=WhatsappQueueEvents;