Built motion from commit 9d0783e6.|2.6.13
[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 _0x48e2=['update','remove','emit','exports','../../mysqldb','WhatsappAccount','setMaxListeners'];(function(_0x5b9709,_0x5ce3e9){var _0x33f2f6=function(_0x2a10fe){while(--_0x2a10fe){_0x5b9709['push'](_0x5b9709['shift']());}};_0x33f2f6(++_0x5ce3e9);}(_0x48e2,0x1d9));var _0x248e=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x48e2[_0x21a9d9];return _0x46adce;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x248e('0x0'))['db'][_0x248e('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x248e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x248e('0x3'),'afterDestroy':_0x248e('0x4')};function emitEvent(_0x42e964){return function(_0xf0ee9a,_0x3ca46d,_0x1b9998){WhatsappAccountEvents['emit'](_0x42e964+':'+_0xf0ee9a['id'],_0xf0ee9a);WhatsappAccountEvents[_0x248e('0x5')](_0x42e964,_0xf0ee9a);_0x1b9998(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x248e('0x6')]=WhatsappAccountEvents;