25668efc7f605f97075e3db344ec5894c4407010
[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 _0x3663=['../../mysqldb','ChatWebsite','save','update','emit','hasOwnProperty','hook','events'];(function(_0x786e9,_0x1a029){var _0x1f891b=function(_0x31ad7c){while(--_0x31ad7c){_0x786e9['push'](_0x786e9['shift']());}};_0x1f891b(++_0x1a029);}(_0x3663,0x1cf));var _0x3366=function(_0x58f012,_0x2dce4e){_0x58f012=_0x58f012-0x0;var _0x3d7842=_0x3663[_0x58f012];return _0x3d7842;};'use strict';var EventEmitter=require(_0x3366('0x0'));var ChatWebsite=require(_0x3366('0x1'))['db'][_0x3366('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3366('0x3'),'afterUpdate':_0x3366('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2daeb7){return function(_0x206d65,_0x2c87e1,_0x16593e){ChatWebsiteEvents[_0x3366('0x5')](_0x2daeb7+':'+_0x206d65['id'],_0x206d65);ChatWebsiteEvents['emit'](_0x2daeb7,_0x206d65);_0x16593e(null);};}for(var e in events){if(events[_0x3366('0x6')](e)){var event=events[e];ChatWebsite[_0x3366('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;