Built motion from commit (unavailable).|2.5.21
[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 _0xb9db=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xb9db,0xef));var _0xbb9d=function(_0x5cb1f2,_0x869dac){_0x5cb1f2=_0x5cb1f2-0x0;var _0x29ea3b=_0xb9db[_0x5cb1f2];return _0x29ea3b;};'use strict';var EventEmitter=require(_0xbb9d('0x0'));var WhatsappQueue=require(_0xbb9d('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xbb9d('0x2')](0x0);var events={'afterCreate':_0xbb9d('0x3'),'afterUpdate':_0xbb9d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x40633c){return function(_0x2ef55b,_0x1a1b4c,_0x4f5d56){WhatsappQueueEvents[_0xbb9d('0x5')](_0x40633c+':'+_0x2ef55b['id'],_0x2ef55b);WhatsappQueueEvents['emit'](_0x40633c,_0x2ef55b);_0x4f5d56(null);};}for(var e in events){if(events[_0xbb9d('0x6')](e)){var event=events[e];WhatsappQueue[_0xbb9d('0x7')](e,emitEvent(event));}}module[_0xbb9d('0x8')]=WhatsappQueueEvents;