Built motion from commit 0900f080.|2.5.45
[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 _0xefe8=['ChatInternalMessage','update','remove','hasOwnProperty','hook','exports','events'];(function(_0x1f470a,_0x36c10e){var _0x39c13d=function(_0x27592c){while(--_0x27592c){_0x1f470a['push'](_0x1f470a['shift']());}};_0x39c13d(++_0x36c10e);}(_0xefe8,0xc3));var _0x8efe=function(_0x1519ec,_0x26ab64){_0x1519ec=_0x1519ec-0x0;var _0x4ebabc=_0xefe8[_0x1519ec];return _0x4ebabc;};'use strict';var EventEmitter=require(_0x8efe('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x8efe('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x8efe('0x2'),'afterDestroy':_0x8efe('0x3')};function emitEvent(_0xa8175e){return function(_0xc4b454,_0x3de15f,_0x3c1c5f){ChatInternalMessageEvents['emit'](_0xa8175e+':'+_0xc4b454['id'],_0xc4b454);ChatInternalMessageEvents['emit'](_0xa8175e,_0xc4b454);_0x3c1c5f(null);};}for(var e in events){if(events[_0x8efe('0x4')](e)){var event=events[e];ChatInternalMessage[_0x8efe('0x5')](e,emitEvent(event));}}module[_0x8efe('0x6')]=ChatInternalMessageEvents;