Built motion from commit (unavailable).|2.5.14
[motion2.git] / server / api / whatsappAccount / whatsappAccount.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 _0x33af=['hook','exports','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x2152f5,_0xbd773b){var _0x34515c=function(_0x484ca8){while(--_0x484ca8){_0x2152f5['push'](_0x2152f5['shift']());}};_0x34515c(++_0xbd773b);}(_0x33af,0xec));var _0xf33a=function(_0x1f20c1,_0x350567){_0x1f20c1=_0x1f20c1-0x0;var _0x548c58=_0x33af[_0x1f20c1];return _0x548c58;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xf33a('0x0'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xf33a('0x1')](0x0);var events={'afterCreate':_0xf33a('0x2'),'afterUpdate':_0xf33a('0x3'),'afterDestroy':_0xf33a('0x4')};function emitEvent(_0x169f02){return function(_0x25f156,_0x4c734e,_0x433e25){WhatsappAccountEvents[_0xf33a('0x5')](_0x169f02+':'+_0x25f156['id'],_0x25f156);WhatsappAccountEvents['emit'](_0x169f02,_0x25f156);_0x433e25(null);};}for(var e in events){if(events[_0xf33a('0x6')](e)){var event=events[e];WhatsappAccount[_0xf33a('0x7')](e,emitEvent(event));}}module[_0xf33a('0x8')]=WhatsappAccountEvents;