Built motion from commit (unavailable).|2.5.9
[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 _0x34c6=['save','update','emit','hook','exports','events','ChatInternalMessage','setMaxListeners'];(function(_0x2d4647,_0x457cdf){var _0x244448=function(_0x1ce50e){while(--_0x1ce50e){_0x2d4647['push'](_0x2d4647['shift']());}};_0x244448(++_0x457cdf);}(_0x34c6,0x1cd));var _0x634c=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x34c6[_0x19950b];return _0x3c6b41;};'use strict';var EventEmitter=require(_0x634c('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x634c('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x634c('0x2')](0x0);var events={'afterCreate':_0x634c('0x3'),'afterUpdate':_0x634c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4bfee5){return function(_0x2fcac2,_0x2c941c,_0x3aa78b){ChatInternalMessageEvents['emit'](_0x4bfee5+':'+_0x2fcac2['id'],_0x2fcac2);ChatInternalMessageEvents[_0x634c('0x5')](_0x4bfee5,_0x2fcac2);_0x3aa78b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x634c('0x6')](e,emitEvent(event));}}module[_0x634c('0x7')]=ChatInternalMessageEvents;