Built motion from commit c738b9ac.|2.6.25
[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 _0x8b37=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','remove'];(function(_0x5e79c6,_0x53d559){var _0x5f027c=function(_0x3d1de7){while(--_0x3d1de7){_0x5e79c6['push'](_0x5e79c6['shift']());}};_0x5f027c(++_0x53d559);}(_0x8b37,0x109));var _0x78b3=function(_0x491e91,_0x25743b){_0x491e91=_0x491e91-0x0;var _0x25ae85=_0x8b37[_0x491e91];return _0x25ae85;};'use strict';var EventEmitter=require(_0x78b3('0x0'));var WhatsappQueue=require(_0x78b3('0x1'))['db'][_0x78b3('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x78b3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x78b3('0x4')};function emitEvent(_0x4e703b){return function(_0x299dcf,_0x142b7f,_0x408193){WhatsappQueueEvents[_0x78b3('0x5')](_0x4e703b+':'+_0x299dcf['id'],_0x299dcf);WhatsappQueueEvents[_0x78b3('0x5')](_0x4e703b,_0x299dcf);_0x408193(null);};}for(var e in events){if(events[_0x78b3('0x6')](e)){var event=events[e];WhatsappQueue[_0x78b3('0x7')](e,emitEvent(event));}}module[_0x78b3('0x8')]=WhatsappQueueEvents;