Built motion from commit (unavailable).|2.5.14
[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 _0xa46e=['../../mysqldb','WhatsappQueue','setMaxListeners','remove','emit','hook','exports','events'];(function(_0x200a81,_0x330c6b){var _0x5c8a90=function(_0x1b0c49){while(--_0x1b0c49){_0x200a81['push'](_0x200a81['shift']());}};_0x5c8a90(++_0x330c6b);}(_0xa46e,0x13f));var _0xea46=function(_0x18f64a,_0x1c8248){_0x18f64a=_0x18f64a-0x0;var _0x44687f=_0xa46e[_0x18f64a];return _0x44687f;};'use strict';var EventEmitter=require(_0xea46('0x0'));var WhatsappQueue=require(_0xea46('0x1'))['db'][_0xea46('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xea46('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xea46('0x4')};function emitEvent(_0x2d8052){return function(_0x329d73,_0x321176,_0x3480d4){WhatsappQueueEvents[_0xea46('0x5')](_0x2d8052+':'+_0x329d73['id'],_0x329d73);WhatsappQueueEvents['emit'](_0x2d8052,_0x329d73);_0x3480d4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xea46('0x6')](e,emitEvent(event));}}module[_0xea46('0x7')]=WhatsappQueueEvents;