Built motion from commit 3c2ce842.|2.6.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 _0x5458=['remove','emit','hasOwnProperty','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update'];(function(_0xc38cb0,_0x53d0dd){var _0x55bb59=function(_0x2e2cd4){while(--_0x2e2cd4){_0xc38cb0['push'](_0xc38cb0['shift']());}};_0x55bb59(++_0x53d0dd);}(_0x5458,0x1e0));var _0x8545=function(_0x2e80f2,_0x4a8364){_0x2e80f2=_0x2e80f2-0x0;var _0x12ef3c=_0x5458[_0x2e80f2];return _0x12ef3c;};'use strict';var EventEmitter=require(_0x8545('0x0'));var WhatsappAccount=require(_0x8545('0x1'))['db'][_0x8545('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x8545('0x3')](0x0);var events={'afterCreate':_0x8545('0x4'),'afterUpdate':_0x8545('0x5'),'afterDestroy':_0x8545('0x6')};function emitEvent(_0x84992){return function(_0x38de41,_0x26c34b,_0x18bbb7){WhatsappAccountEvents[_0x8545('0x7')](_0x84992+':'+_0x38de41['id'],_0x38de41);WhatsappAccountEvents[_0x8545('0x7')](_0x84992,_0x38de41);_0x18bbb7(null);};}for(var e in events){if(events[_0x8545('0x8')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents;