Built motion from commit 5b761a7b.|2.5.36
[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 _0xc68e=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x44c83f,_0x464d42){var _0x103ca4=function(_0x404703){while(--_0x404703){_0x44c83f['push'](_0x44c83f['shift']());}};_0x103ca4(++_0x464d42);}(_0xc68e,0x1e4));var _0xec68=function(_0x54b40d,_0x47c8cf){_0x54b40d=_0x54b40d-0x0;var _0x3b2eec=_0xc68e[_0x54b40d];return _0x3b2eec;};'use strict';var EventEmitter=require(_0xec68('0x0'));var WhatsappAccount=require(_0xec68('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xec68('0x2')](0x0);var events={'afterCreate':_0xec68('0x3'),'afterUpdate':'update','afterDestroy':_0xec68('0x4')};function emitEvent(_0x142e9b){return function(_0xfe739b,_0x49a0a5,_0x260386){WhatsappAccountEvents['emit'](_0x142e9b+':'+_0xfe739b['id'],_0xfe739b);WhatsappAccountEvents[_0xec68('0x5')](_0x142e9b,_0xfe739b);_0x260386(null);};}for(var e in events){if(events[_0xec68('0x6')](e)){var event=events[e];WhatsappAccount[_0xec68('0x7')](e,emitEvent(event));}}module[_0xec68('0x8')]=WhatsappAccountEvents;