Built motion from commit (unavailable).|2.5.21
[motion2.git] / server / api / chatWebsite / chatWebsite.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 _0xea09=['emit','hasOwnProperty','hook','exports','ChatWebsite','remove'];(function(_0x29320d,_0x5a5a68){var _0x3b8dca=function(_0x30d1dd){while(--_0x30d1dd){_0x29320d['push'](_0x29320d['shift']());}};_0x3b8dca(++_0x5a5a68);}(_0xea09,0xd0));var _0x9ea0=function(_0x9db07,_0x58d3a1){_0x9db07=_0x9db07-0x0;var _0x344e18=_0xea09[_0x9db07];return _0x344e18;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0x9ea0('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x9ea0('0x1')};function emitEvent(_0x2cdd23){return function(_0x5cd3a7,_0x5a679f,_0x16f51a){ChatWebsiteEvents[_0x9ea0('0x2')](_0x2cdd23+':'+_0x5cd3a7['id'],_0x5cd3a7);ChatWebsiteEvents['emit'](_0x2cdd23,_0x5cd3a7);_0x16f51a(null);};}for(var e in events){if(events[_0x9ea0('0x3')](e)){var event=events[e];ChatWebsite[_0x9ea0('0x4')](e,emitEvent(event));}}module[_0x9ea0('0x5')]=ChatWebsiteEvents;