Built motion from commit b0a9a629.|2.6.33
[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 _0x8e7c=['../../mysqldb','WhatsappQueue','setMaxListeners','update','emit','hasOwnProperty','events'];(function(_0x35ce45,_0x533d08){var _0x1144be=function(_0x1f9a8c){while(--_0x1f9a8c){_0x35ce45['push'](_0x35ce45['shift']());}};_0x1144be(++_0x533d08);}(_0x8e7c,0x11e));var _0xc8e7=function(_0x2d5eab,_0x4243c7){_0x2d5eab=_0x2d5eab-0x0;var _0x48d4c3=_0x8e7c[_0x2d5eab];return _0x48d4c3;};'use strict';var EventEmitter=require(_0xc8e7('0x0'));var WhatsappQueue=require(_0xc8e7('0x1'))['db'][_0xc8e7('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xc8e7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc8e7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4e9ae2){return function(_0x3ab9b8,_0x530bc5,_0x5bbaa6){WhatsappQueueEvents[_0xc8e7('0x5')](_0x4e9ae2+':'+_0x3ab9b8['id'],_0x3ab9b8);WhatsappQueueEvents[_0xc8e7('0x5')](_0x4e9ae2,_0x3ab9b8);_0x5bbaa6(null);};}for(var e in events){if(events[_0xc8e7('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;