Built motion from commit 58b0471d.|2.6.29
[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 _0x17db=['remove','emit','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save'];(function(_0x4703f1,_0xab71e4){var _0x583347=function(_0x538f5f){while(--_0x538f5f){_0x4703f1['push'](_0x4703f1['shift']());}};_0x583347(++_0xab71e4);}(_0x17db,0x1eb));var _0xb17d=function(_0x356709,_0x4c6bf8){_0x356709=_0x356709-0x0;var _0x291cde=_0x17db[_0x356709];return _0x291cde;};'use strict';var EventEmitter=require(_0xb17d('0x0'));var WhatsappAccount=require(_0xb17d('0x1'))['db'][_0xb17d('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xb17d('0x3')](0x0);var events={'afterCreate':_0xb17d('0x4'),'afterUpdate':'update','afterDestroy':_0xb17d('0x5')};function emitEvent(_0xbfa5f0){return function(_0x52e290,_0x4da14c,_0x5457b5){WhatsappAccountEvents[_0xb17d('0x6')](_0xbfa5f0+':'+_0x52e290['id'],_0x52e290);WhatsappAccountEvents['emit'](_0xbfa5f0,_0x52e290);_0x5457b5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0xb17d('0x7')]=WhatsappAccountEvents;