Built motion from commit 2e4747fd.|2.6.7
[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 _0x9653=['setMaxListeners','save','update','remove','emit','hook','../../mysqldb','WhatsappQueue'];(function(_0x41f8f3,_0x4fb3cc){var _0x22dd07=function(_0x56711e){while(--_0x56711e){_0x41f8f3['push'](_0x41f8f3['shift']());}};_0x22dd07(++_0x4fb3cc);}(_0x9653,0x1a6));var _0x3965=function(_0x2843d2,_0x27cfa5){_0x2843d2=_0x2843d2-0x0;var _0x214d1b=_0x9653[_0x2843d2];return _0x214d1b;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x3965('0x0'))['db'][_0x3965('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x3965('0x2')](0x0);var events={'afterCreate':_0x3965('0x3'),'afterUpdate':_0x3965('0x4'),'afterDestroy':_0x3965('0x5')};function emitEvent(_0x798367){return function(_0x22a00d,_0x3875e8,_0x32d86a){WhatsappQueueEvents[_0x3965('0x6')](_0x798367+':'+_0x22a00d['id'],_0x22a00d);WhatsappQueueEvents[_0x3965('0x6')](_0x798367,_0x22a00d);_0x32d86a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x3965('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;