Built motion from commit 25580385.|2.6.2
[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 _0x553d=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappAccount','setMaxListeners'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x553d,0x16e));var _0xd553=function(_0x3af9c7,_0x44289b){_0x3af9c7=_0x3af9c7-0x0;var _0x1ad392=_0x553d[_0x3af9c7];return _0x1ad392;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xd553('0x0'))['db'][_0xd553('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xd553('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd553('0x3'),'afterDestroy':_0xd553('0x4')};function emitEvent(_0x51e6da){return function(_0x1f7321,_0x111911,_0xa0044a){WhatsappAccountEvents['emit'](_0x51e6da+':'+_0x1f7321['id'],_0x1f7321);WhatsappAccountEvents[_0xd553('0x5')](_0x51e6da,_0x1f7321);_0xa0044a(null);};}for(var e in events){if(events[_0xd553('0x6')](e)){var event=events[e];WhatsappAccount[_0xd553('0x7')](e,emitEvent(event));}}module[_0xd553('0x8')]=WhatsappAccountEvents;