c1d73c3a99b5743e985fbfce4c7320b272c5d9c2
[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 _0xa496=['exports','../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x13187a,_0x2fcec4){var _0x65b85f=function(_0x33bf1f){while(--_0x33bf1f){_0x13187a['push'](_0x13187a['shift']());}};_0x65b85f(++_0x2fcec4);}(_0xa496,0xa1));var _0x6a49=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa496[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x6a49('0x0'))['db'][_0x6a49('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x6a49('0x2')](0x0);var events={'afterCreate':_0x6a49('0x3'),'afterUpdate':_0x6a49('0x4'),'afterDestroy':_0x6a49('0x5')};function emitEvent(_0x5b6f94){return function(_0x13fe6d,_0x2e7180,_0x5bbca1){WhatsappQueueEvents[_0x6a49('0x6')](_0x5b6f94+':'+_0x13fe6d['id'],_0x13fe6d);WhatsappQueueEvents['emit'](_0x5b6f94,_0x13fe6d);_0x5bbca1(null);};}for(var e in events){if(events[_0x6a49('0x7')](e)){var event=events[e];WhatsappQueue[_0x6a49('0x8')](e,emitEvent(event));}}module[_0x6a49('0x9')]=WhatsappQueueEvents;