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 _0xd9fb=['emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','remove'];(function(_0x92116d,_0xa6ee1b){var _0xfe4f60=function(_0x1f052d){while(--_0x1f052d){_0x92116d['push'](_0x92116d['shift']());}};_0xfe4f60(++_0xa6ee1b);}(_0xd9fb,0x189));var _0xbd9f=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xd9fb[_0x3054be];return _0x3df150;};'use strict';var EventEmitter=require(_0xbd9f('0x0'));var WhatsappAccount=require(_0xbd9f('0x1'))['db'][_0xbd9f('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xbd9f('0x3')](0x0);var events={'afterCreate':_0xbd9f('0x4'),'afterUpdate':_0xbd9f('0x5'),'afterDestroy':_0xbd9f('0x6')};function emitEvent(_0x56fe1b){return function(_0x2d4213,_0xf146bc,_0x4ce2e2){WhatsappAccountEvents[_0xbd9f('0x7')](_0x56fe1b+':'+_0x2d4213['id'],_0x2d4213);WhatsappAccountEvents['emit'](_0x56fe1b,_0x2d4213);_0x4ce2e2(null);};}for(var e in events){if(events[_0xbd9f('0x8')](e)){var event=events[e];WhatsappAccount[_0xbd9f('0x9')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents;