Built motion from commit a61a4a20.|2.5.46
[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 _0x695c=['hook','exports','../../mysqldb','WhatsappAccount','update','remove','emit','hasOwnProperty'];(function(_0x5b6e0a,_0x1ed301){var _0xfbc00b=function(_0x492855){while(--_0x492855){_0x5b6e0a['push'](_0x5b6e0a['shift']());}};_0xfbc00b(++_0x1ed301);}(_0x695c,0x16a));var _0xc695=function(_0xa9dd88,_0x358002){_0xa9dd88=_0xa9dd88-0x0;var _0x33678d=_0x695c[_0xa9dd88];return _0x33678d;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xc695('0x0'))['db'][_0xc695('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc695('0x2'),'afterDestroy':_0xc695('0x3')};function emitEvent(_0xb187e2){return function(_0x782ed3,_0x58a9fd,_0x12e131){WhatsappAccountEvents[_0xc695('0x4')](_0xb187e2+':'+_0x782ed3['id'],_0x782ed3);WhatsappAccountEvents[_0xc695('0x4')](_0xb187e2,_0x782ed3);_0x12e131(null);};}for(var e in events){if(events[_0xc695('0x5')](e)){var event=events[e];WhatsappAccount[_0xc695('0x6')](e,emitEvent(event));}}module[_0xc695('0x7')]=WhatsappAccountEvents;