Built motion from commit efa66e19.|2.6.22
[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 _0xb6f1=['events','ChatWebsite','save','update','remove','emit','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb6f1,0x118));var _0x1b6f=function(_0x2211ed,_0x1bca0b){_0x2211ed=_0x2211ed-0x0;var _0x4d78cc=_0xb6f1[_0x2211ed];return _0x4d78cc;};'use strict';var EventEmitter=require(_0x1b6f('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x1b6f('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1b6f('0x2'),'afterUpdate':_0x1b6f('0x3'),'afterDestroy':_0x1b6f('0x4')};function emitEvent(_0x4cd86b){return function(_0x2cd276,_0x58afbb,_0x3aa4e8){ChatWebsiteEvents[_0x1b6f('0x5')](_0x4cd86b+':'+_0x2cd276['id'],_0x2cd276);ChatWebsiteEvents[_0x1b6f('0x5')](_0x4cd86b,_0x2cd276);_0x3aa4e8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x1b6f('0x6')]=ChatWebsiteEvents;