Built motion from commit 9d7072cc.|2.5.39
[motion2.git] / server / api / chatInternalMessage / chatInternalMessage.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 _0x09fb=['exports','../../mysqldb','save','update','emit'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x09fb,0xc4));var _0xb09f=function(_0x39d245,_0x2149a8){_0x39d245=_0x39d245-0x0;var _0x3c8cf6=_0x09fb[_0x39d245];return _0x3c8cf6;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xb09f('0x0'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb09f('0x1'),'afterUpdate':_0xb09f('0x2'),'afterDestroy':'remove'};function emitEvent(_0x29efce){return function(_0x35c781,_0x1439b2,_0xcd7936){ChatInternalMessageEvents[_0xb09f('0x3')](_0x29efce+':'+_0x35c781['id'],_0x35c781);ChatInternalMessageEvents[_0xb09f('0x3')](_0x29efce,_0x35c781);_0xcd7936(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xb09f('0x4')]=ChatInternalMessageEvents;