Built motion from commit 753c950e.|2.5.42
[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 _0x0de9=['events','../../mysqldb','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5d7df8,_0x5b4d06){var _0x413678=function(_0x1f6e3d){while(--_0x1f6e3d){_0x5d7df8['push'](_0x5d7df8['shift']());}};_0x413678(++_0x5b4d06);}(_0x0de9,0x140));var _0x90de=function(_0x1bd30f,_0x23ce43){_0x1bd30f=_0x1bd30f-0x0;var _0x3c9675=_0x0de9[_0x1bd30f];return _0x3c9675;};'use strict';var EventEmitter=require(_0x90de('0x0'));var WhatsappAccount=require(_0x90de('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x90de('0x2'),'afterUpdate':'update','afterDestroy':_0x90de('0x3')};function emitEvent(_0x10d52d){return function(_0x209ed6,_0x3ecfbb,_0x2bee63){WhatsappAccountEvents[_0x90de('0x4')](_0x10d52d+':'+_0x209ed6['id'],_0x209ed6);WhatsappAccountEvents[_0x90de('0x4')](_0x10d52d,_0x209ed6);_0x2bee63(null);};}for(var e in events){if(events[_0x90de('0x5')](e)){var event=events[e];WhatsappAccount[_0x90de('0x6')](e,emitEvent(event));}}module[_0x90de('0x7')]=WhatsappAccountEvents;