Built motion from commit 85328c08.|2.5.50
[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 _0x6b62=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappAccount','save'];(function(_0x5ea8fb,_0xc46f1c){var _0xc97803=function(_0x394c3e){while(--_0x394c3e){_0x5ea8fb['push'](_0x5ea8fb['shift']());}};_0xc97803(++_0xc46f1c);}(_0x6b62,0xf0));var _0x26b6=function(_0x452814,_0x2c4a23){_0x452814=_0x452814-0x0;var _0x335f41=_0x6b62[_0x452814];return _0x335f41;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x26b6('0x0'))['db'][_0x26b6('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x26b6('0x2'),'afterUpdate':_0x26b6('0x3'),'afterDestroy':_0x26b6('0x4')};function emitEvent(_0x1c8838){return function(_0x21db5a,_0x115c64,_0x3bdac8){WhatsappAccountEvents[_0x26b6('0x5')](_0x1c8838+':'+_0x21db5a['id'],_0x21db5a);WhatsappAccountEvents[_0x26b6('0x5')](_0x1c8838,_0x21db5a);_0x3bdac8(null);};}for(var e in events){if(events[_0x26b6('0x6')](e)){var event=events[e];WhatsappAccount[_0x26b6('0x7')](e,emitEvent(event));}}module[_0x26b6('0x8')]=WhatsappAccountEvents;