Built motion from commit (unavailable).|2.5.31
[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 _0x0a6b=['hasOwnProperty','exports','events','save','remove','emit'];(function(_0x43b06b,_0x1929c7){var _0x2c555b=function(_0x30fa8c){while(--_0x30fa8c){_0x43b06b['push'](_0x43b06b['shift']());}};_0x2c555b(++_0x1929c7);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x1492bd,_0x1ad636){_0x1492bd=_0x1492bd-0x0;var _0x317259=_0x0a6b[_0x1492bd];return _0x317259;};'use strict';var EventEmitter=require(_0xb0a6('0x0'));var WhatsappAccount=require('../../mysqldb')['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb0a6('0x1'),'afterUpdate':'update','afterDestroy':_0xb0a6('0x2')};function emitEvent(_0x13dc41){return function(_0x1d3b78,_0x544a64,_0x102ecd){WhatsappAccountEvents['emit'](_0x13dc41+':'+_0x1d3b78['id'],_0x1d3b78);WhatsappAccountEvents[_0xb0a6('0x3')](_0x13dc41,_0x1d3b78);_0x102ecd(null);};}for(var e in events){if(events[_0xb0a6('0x4')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0xb0a6('0x5')]=WhatsappAccountEvents;