06bcc6dacaaf56b3e0f201406e00133cf8c634f1
[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 _0x40bb=['remove','emit','hasOwnProperty','hook','exports','WhatsappAccount','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x40bb,0x1d5));var _0xb40b=function(_0x3994e4,_0x5ca440){_0x3994e4=_0x3994e4-0x0;var _0xec1ac=_0x40bb[_0x3994e4];return _0xec1ac;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require('../../mysqldb')['db'][_0xb40b('0x0')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb40b('0x1'),'afterUpdate':_0xb40b('0x2'),'afterDestroy':_0xb40b('0x3')};function emitEvent(_0x1b0081){return function(_0x16b715,_0x12e1e3,_0x21c269){WhatsappAccountEvents[_0xb40b('0x4')](_0x1b0081+':'+_0x16b715['id'],_0x16b715);WhatsappAccountEvents['emit'](_0x1b0081,_0x16b715);_0x21c269(null);};}for(var e in events){if(events[_0xb40b('0x5')](e)){var event=events[e];WhatsappAccount[_0xb40b('0x6')](e,emitEvent(event));}}module[_0xb40b('0x7')]=WhatsappAccountEvents;