Built motion from commit 9d7072cc.|2.5.39
[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 _0x56de=['update','remove','emit','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','save'];(function(_0x2aaa60,_0x22258f){var _0x2e3fa5=function(_0x335589){while(--_0x335589){_0x2aaa60['push'](_0x2aaa60['shift']());}};_0x2e3fa5(++_0x22258f);}(_0x56de,0x16c));var _0xe56d=function(_0x52c932,_0x4fcaed){_0x52c932=_0x52c932-0x0;var _0x403e9a=_0x56de[_0x52c932];return _0x403e9a;};'use strict';var EventEmitter=require(_0xe56d('0x0'));var WhatsappQueue=require(_0xe56d('0x1'))['db'][_0xe56d('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xe56d('0x3')](0x0);var events={'afterCreate':_0xe56d('0x4'),'afterUpdate':_0xe56d('0x5'),'afterDestroy':_0xe56d('0x6')};function emitEvent(_0x13c620){return function(_0xb542b4,_0x146b6d,_0x10ac15){WhatsappQueueEvents['emit'](_0x13c620+':'+_0xb542b4['id'],_0xb542b4);WhatsappQueueEvents[_0xe56d('0x7')](_0x13c620,_0xb542b4);_0x10ac15(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xe56d('0x8')]=WhatsappQueueEvents;