Built motion from commit 3c2ce842.|2.6.31
[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 _0x9f8e=['WhatsappQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x3d8d62,_0x5a159e){var _0x2a18f3=function(_0x15dd29){while(--_0x15dd29){_0x3d8d62['push'](_0x3d8d62['shift']());}};_0x2a18f3(++_0x5a159e);}(_0x9f8e,0x1ca));var _0xe9f8=function(_0x254971,_0x4f60ca){_0x254971=_0x254971-0x0;var _0x2452ca=_0x9f8e[_0x254971];return _0x2452ca;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xe9f8('0x0'))['db'][_0xe9f8('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xe9f8('0x2')](0x0);var events={'afterCreate':_0xe9f8('0x3'),'afterUpdate':_0xe9f8('0x4'),'afterDestroy':'remove'};function emitEvent(_0xa73964){return function(_0x3e59a7,_0x7a8358,_0xbb4c14){WhatsappQueueEvents[_0xe9f8('0x5')](_0xa73964+':'+_0x3e59a7['id'],_0x3e59a7);WhatsappQueueEvents[_0xe9f8('0x5')](_0xa73964,_0x3e59a7);_0xbb4c14(null);};}for(var e in events){if(events[_0xe9f8('0x6')](e)){var event=events[e];WhatsappQueue[_0xe9f8('0x7')](e,emitEvent(event));}}module[_0xe9f8('0x8')]=WhatsappQueueEvents;