Built motion from commit 994c64e1.|2.6.1
[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 _0x3214=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','remove'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3214,0xca));var _0x4321=function(_0xa8ff2f,_0x43e207){_0xa8ff2f=_0xa8ff2f-0x0;var _0x1c27af=_0x3214[_0xa8ff2f];return _0x1c27af;};'use strict';var EventEmitter=require(_0x4321('0x0'));var WhatsappQueue=require(_0x4321('0x1'))['db'][_0x4321('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x4321('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x4321('0x4')};function emitEvent(_0x16c583){return function(_0x3bbaf9,_0x14276d,_0x29332f){WhatsappQueueEvents[_0x4321('0x5')](_0x16c583+':'+_0x3bbaf9['id'],_0x3bbaf9);WhatsappQueueEvents[_0x4321('0x5')](_0x16c583,_0x3bbaf9);_0x29332f(null);};}for(var e in events){if(events[_0x4321('0x6')](e)){var event=events[e];WhatsappQueue[_0x4321('0x7')](e,emitEvent(event));}}module[_0x4321('0x8')]=WhatsappQueueEvents;