Built motion from commit bab6f49e.|2.6.17
[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 _0x09cb=['remove','hasOwnProperty','hook','exports','events','ChatInternalMessage','setMaxListeners','save','update'];(function(_0x2d47ed,_0x260bb5){var _0x1f53f5=function(_0x276fbc){while(--_0x276fbc){_0x2d47ed['push'](_0x2d47ed['shift']());}};_0x1f53f5(++_0x260bb5);}(_0x09cb,0x109));var _0xb09c=function(_0x267202,_0x5e360f){_0x267202=_0x267202-0x0;var _0x74d3bb=_0x09cb[_0x267202];return _0x74d3bb;};'use strict';var EventEmitter=require(_0xb09c('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xb09c('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb09c('0x2')](0x0);var events={'afterCreate':_0xb09c('0x3'),'afterUpdate':_0xb09c('0x4'),'afterDestroy':_0xb09c('0x5')};function emitEvent(_0x53e85a){return function(_0x2ae3b8,_0x4a2a7b,_0x538421){ChatInternalMessageEvents['emit'](_0x53e85a+':'+_0x2ae3b8['id'],_0x2ae3b8);ChatInternalMessageEvents['emit'](_0x53e85a,_0x2ae3b8);_0x538421(null);};}for(var e in events){if(events[_0xb09c('0x6')](e)){var event=events[e];ChatInternalMessage[_0xb09c('0x7')](e,emitEvent(event));}}module[_0xb09c('0x8')]=ChatInternalMessageEvents;