Built motion from commit (unavailable).|2.5.21
[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 _0x0e4b=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','save'];(function(_0x403ad6,_0x137771){var _0x4736bc=function(_0xf039a){while(--_0xf039a){_0x403ad6['push'](_0x403ad6['shift']());}};_0x4736bc(++_0x137771);}(_0x0e4b,0xdc));var _0xb0e4=function(_0x2514b2,_0x277f33){_0x2514b2=_0x2514b2-0x0;var _0x416a21=_0x0e4b[_0x2514b2];return _0x416a21;};'use strict';var EventEmitter=require(_0xb0e4('0x0'));var WhatsappAccount=require(_0xb0e4('0x1'))['db'][_0xb0e4('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb0e4('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4e2500){return function(_0x538147,_0x79717e,_0x136402){WhatsappAccountEvents['emit'](_0x4e2500+':'+_0x538147['id'],_0x538147);WhatsappAccountEvents[_0xb0e4('0x4')](_0x4e2500,_0x538147);_0x136402(null);};}for(var e in events){if(events[_0xb0e4('0x5')](e)){var event=events[e];WhatsappAccount[_0xb0e4('0x6')](e,emitEvent(event));}}module[_0xb0e4('0x7')]=WhatsappAccountEvents;