Built motion from commit 06eb8eb0.|2.6.31
[motion2.git] / server / api / whatsappMessage / whatsappMessage.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 _0xa902=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappMessage'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xa902,0x8d));var _0x2a90=function(_0x5bd867,_0x138bbd){_0x5bd867=_0x5bd867-0x0;var _0x3e368e=_0xa902[_0x5bd867];return _0x3e368e;};'use strict';var EventEmitter=require(_0x2a90('0x0'));var WhatsappMessage=require(_0x2a90('0x1'))['db'][_0x2a90('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x2a90('0x3')](0x0);var events={'afterCreate':_0x2a90('0x4'),'afterUpdate':'update','afterDestroy':_0x2a90('0x5')};function emitEvent(_0x5b4a40){return function(_0x4961c2,_0x169808,_0x2b40c0){WhatsappMessageEvents[_0x2a90('0x6')](_0x5b4a40+':'+_0x4961c2['id'],_0x4961c2);WhatsappMessageEvents[_0x2a90('0x6')](_0x5b4a40,_0x4961c2);_0x2b40c0(null);};}for(var e in events){if(events[_0x2a90('0x7')](e)){var event=events[e];WhatsappMessage[_0x2a90('0x8')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents;