Built motion from commit (unavailable).|2.5.11
[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 _0x6050=['events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','hasOwnProperty'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x6050,0x196));var _0x0605=function(_0x4c6206,_0xb61c58){_0x4c6206=_0x4c6206-0x0;var _0x24291c=_0x6050[_0x4c6206];return _0x24291c;};'use strict';var EventEmitter=require(_0x0605('0x0'));var WhatsappAccount=require(_0x0605('0x1'))['db'][_0x0605('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x0605('0x3')](0x0);var events={'afterCreate':_0x0605('0x4'),'afterUpdate':_0x0605('0x5'),'afterDestroy':'remove'};function emitEvent(_0x22d595){return function(_0x4576f4,_0x43403d,_0x5797b0){WhatsappAccountEvents['emit'](_0x22d595+':'+_0x4576f4['id'],_0x4576f4);WhatsappAccountEvents['emit'](_0x22d595,_0x4576f4);_0x5797b0(null);};}for(var e in events){if(events[_0x0605('0x6')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents;