Built motion from commit 449495f6.|2.6.27
[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 _0x8c2b=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x2f569b,_0x4a4556){var _0x5da362=function(_0x527810){while(--_0x527810){_0x2f569b['push'](_0x2f569b['shift']());}};_0x5da362(++_0x4a4556);}(_0x8c2b,0xe5));var _0xb8c2=function(_0x21dc9c,_0x116926){_0x21dc9c=_0x21dc9c-0x0;var _0x1fd707=_0x8c2b[_0x21dc9c];return _0x1fd707;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xb8c2('0x0'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xb8c2('0x1')](0x0);var events={'afterCreate':_0xb8c2('0x2'),'afterUpdate':'update','afterDestroy':_0xb8c2('0x3')};function emitEvent(_0x42f657){return function(_0x4ea3c7,_0x61bd0b,_0x59701d){WhatsappAccountEvents[_0xb8c2('0x4')](_0x42f657+':'+_0x4ea3c7['id'],_0x4ea3c7);WhatsappAccountEvents[_0xb8c2('0x4')](_0x42f657,_0x4ea3c7);_0x59701d(null);};}for(var e in events){if(events[_0xb8c2('0x5')](e)){var event=events[e];WhatsappAccount[_0xb8c2('0x6')](e,emitEvent(event));}}module[_0xb8c2('0x7')]=WhatsappAccountEvents;