Built motion from commit 953226e6.|2.6.32
[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 _0x4de1=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x30e2ba,_0x180fc4){var _0x170a1a=function(_0x9e15c9){while(--_0x9e15c9){_0x30e2ba['push'](_0x30e2ba['shift']());}};_0x170a1a(++_0x180fc4);}(_0x4de1,0x16d));var _0x14de=function(_0x541ea6,_0x51cab6){_0x541ea6=_0x541ea6-0x0;var _0x3c3e84=_0x4de1[_0x541ea6];return _0x3c3e84;};'use strict';var EventEmitter=require(_0x14de('0x0'));var WhatsappAccount=require(_0x14de('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x14de('0x2')](0x0);var events={'afterCreate':_0x14de('0x3'),'afterUpdate':_0x14de('0x4'),'afterDestroy':_0x14de('0x5')};function emitEvent(_0x17c1f4){return function(_0x350ab8,_0x232dfd,_0x22857c){WhatsappAccountEvents['emit'](_0x17c1f4+':'+_0x350ab8['id'],_0x350ab8);WhatsappAccountEvents[_0x14de('0x6')](_0x17c1f4,_0x350ab8);_0x22857c(null);};}for(var e in events){if(events[_0x14de('0x7')](e)){var event=events[e];WhatsappAccount[_0x14de('0x8')](e,emitEvent(event));}}module[_0x14de('0x9')]=WhatsappAccountEvents;