Built motion from commit f6d7e26c.|2.6.14
[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 _0xa27a=['hasOwnProperty','hook','events','../../mysqldb','WhatsappQueue','setMaxListeners','save','remove','emit'];(function(_0x210d1a,_0x44dd0f){var _0x22fa29=function(_0x56289d){while(--_0x56289d){_0x210d1a['push'](_0x210d1a['shift']());}};_0x22fa29(++_0x44dd0f);}(_0xa27a,0x12b));var _0xaa27=function(_0x222df7,_0x3e073f){_0x222df7=_0x222df7-0x0;var _0x2cceae=_0xa27a[_0x222df7];return _0x2cceae;};'use strict';var EventEmitter=require(_0xaa27('0x0'));var WhatsappQueue=require(_0xaa27('0x1'))['db'][_0xaa27('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xaa27('0x3')](0x0);var events={'afterCreate':_0xaa27('0x4'),'afterUpdate':'update','afterDestroy':_0xaa27('0x5')};function emitEvent(_0x42cf34){return function(_0x5a67fc,_0x4b2c98,_0x4816b8){WhatsappQueueEvents[_0xaa27('0x6')](_0x42cf34+':'+_0x5a67fc['id'],_0x5a67fc);WhatsappQueueEvents[_0xaa27('0x6')](_0x42cf34,_0x5a67fc);_0x4816b8(null);};}for(var e in events){if(events[_0xaa27('0x7')](e)){var event=events[e];WhatsappQueue[_0xaa27('0x8')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;