Built motion from commit bab6f49e.|2.6.17
[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 _0xa9c2=['../../mysqldb','WhatsappAccount','save','update','remove','emit'];(function(_0x2b717e,_0x45bc24){var _0x1107b6=function(_0x3e638e){while(--_0x3e638e){_0x2b717e['push'](_0x2b717e['shift']());}};_0x1107b6(++_0x45bc24);}(_0xa9c2,0xd8));var _0x2a9c=function(_0xb32b7,_0x3523ed){_0xb32b7=_0xb32b7-0x0;var _0x2012f8=_0xa9c2[_0xb32b7];return _0x2012f8;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x2a9c('0x0'))['db'][_0x2a9c('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2a9c('0x2'),'afterUpdate':_0x2a9c('0x3'),'afterDestroy':_0x2a9c('0x4')};function emitEvent(_0x2f9c7f){return function(_0x52fcf7,_0x3f34c1,_0x2b365c){WhatsappAccountEvents[_0x2a9c('0x5')](_0x2f9c7f+':'+_0x52fcf7['id'],_0x52fcf7);WhatsappAccountEvents[_0x2a9c('0x5')](_0x2f9c7f,_0x52fcf7);_0x2b365c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents;