Built motion from commit (unavailable).|2.5.31
[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 _0x7336=['save','emit','hook','events'];(function(_0x4c3a6f,_0x31d6f2){var _0x379e12=function(_0x43a170){while(--_0x43a170){_0x4c3a6f['push'](_0x4c3a6f['shift']());}};_0x379e12(++_0x31d6f2);}(_0x7336,0xfb));var _0x6733=function(_0x1e8eff,_0x44f5bd){_0x1e8eff=_0x1e8eff-0x0;var _0x1d3fce=_0x7336[_0x1e8eff];return _0x1d3fce;};'use strict';var EventEmitter=require(_0x6733('0x0'));var WhatsappQueue=require('../../mysqldb')['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6733('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x19d66b){return function(_0x35c121,_0x124797,_0x4bbc05){WhatsappQueueEvents[_0x6733('0x2')](_0x19d66b+':'+_0x35c121['id'],_0x35c121);WhatsappQueueEvents['emit'](_0x19d66b,_0x35c121);_0x4bbc05(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x6733('0x3')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;