855af74f204cc73f36a47647d3acb71294592ced
[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 _0x92ae=['update','remove','emit','hook','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','save'];(function(_0x3a14dc,_0x1cded4){var _0xb9b0f3=function(_0x3c6889){while(--_0x3c6889){_0x3a14dc['push'](_0x3a14dc['shift']());}};_0xb9b0f3(++_0x1cded4);}(_0x92ae,0x69));var _0xe92a=function(_0xc28b61,_0x479098){_0xc28b61=_0xc28b61-0x0;var _0x29830d=_0x92ae[_0xc28b61];return _0x29830d;};'use strict';var EventEmitter=require(_0xe92a('0x0'));var WhatsappQueue=require(_0xe92a('0x1'))['db'][_0xe92a('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xe92a('0x3')](0x0);var events={'afterCreate':_0xe92a('0x4'),'afterUpdate':_0xe92a('0x5'),'afterDestroy':_0xe92a('0x6')};function emitEvent(_0x33973f){return function(_0x484b81,_0x4c3dd3,_0x43489b){WhatsappQueueEvents[_0xe92a('0x7')](_0x33973f+':'+_0x484b81['id'],_0x484b81);WhatsappQueueEvents[_0xe92a('0x7')](_0x33973f,_0x484b81);_0x43489b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xe92a('0x8')](e,emitEvent(event));}}module[_0xe92a('0x9')]=WhatsappQueueEvents;