Built motion from commit (unavailable).|2.5.9
[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 _0x8f9d=['hasOwnProperty','hook','exports','events','WhatsappAccount','save','update','remove','emit'];(function(_0x9ac89b,_0x25b61d){var _0x40da74=function(_0x2643a2){while(--_0x2643a2){_0x9ac89b['push'](_0x9ac89b['shift']());}};_0x40da74(++_0x25b61d);}(_0x8f9d,0x93));var _0xd8f9=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8f9d[_0x57b54c];return _0x59cc19;};'use strict';var EventEmitter=require(_0xd8f9('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0xd8f9('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd8f9('0x2'),'afterUpdate':_0xd8f9('0x3'),'afterDestroy':_0xd8f9('0x4')};function emitEvent(_0x354c26){return function(_0x1f9331,_0x1b82b8,_0x1d6420){WhatsappAccountEvents['emit'](_0x354c26+':'+_0x1f9331['id'],_0x1f9331);WhatsappAccountEvents[_0xd8f9('0x5')](_0x354c26,_0x1f9331);_0x1d6420(null);};}for(var e in events){if(events[_0xd8f9('0x6')](e)){var event=events[e];WhatsappAccount[_0xd8f9('0x7')](e,emitEvent(event));}}module[_0xd8f9('0x8')]=WhatsappAccountEvents;