Built motion from commit (unavailable).|2.5.0
[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 _0x1276=['events','../../mysqldb','WhatsappQueue','setMaxListeners','save','emit','hasOwnProperty','hook','exports'];(function(_0x107113,_0x1587ff){var _0x5996aa=function(_0x530644){while(--_0x530644){_0x107113['push'](_0x107113['shift']());}};_0x5996aa(++_0x1587ff);}(_0x1276,0x195));var _0x6127=function(_0x1870dd,_0x186efa){_0x1870dd=_0x1870dd-0x0;var _0x1d5b86=_0x1276[_0x1870dd];return _0x1d5b86;};'use strict';var EventEmitter=require(_0x6127('0x0'));var WhatsappQueue=require(_0x6127('0x1'))['db'][_0x6127('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x6127('0x3')](0x0);var events={'afterCreate':_0x6127('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xe94cd6){return function(_0x2e96c6,_0x4b3c0d,_0x41dde8){WhatsappQueueEvents[_0x6127('0x5')](_0xe94cd6+':'+_0x2e96c6['id'],_0x2e96c6);WhatsappQueueEvents[_0x6127('0x5')](_0xe94cd6,_0x2e96c6);_0x41dde8(null);};}for(var e in events){if(events[_0x6127('0x6')](e)){var event=events[e];WhatsappQueue[_0x6127('0x7')](e,emitEvent(event));}}module[_0x6127('0x8')]=WhatsappQueueEvents;