Built motion from commit (unavailable).|2.4.21
[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 _0x40c2=['emit','hasOwnProperty','exports','../../mysqldb','ChatInternalMessage','setMaxListeners','save'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x40c2,0x10d));var _0x240c=function(_0x270e77,_0x4628fe){_0x270e77=_0x270e77-0x0;var _0x2d03ac=_0x40c2[_0x270e77];return _0x2d03ac;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x240c('0x0'))['db'][_0x240c('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x240c('0x2')](0x0);var events={'afterCreate':_0x240c('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x25a75a){return function(_0x1827b7,_0x6cb99e,_0x3c3213){ChatInternalMessageEvents[_0x240c('0x4')](_0x25a75a+':'+_0x1827b7['id'],_0x1827b7);ChatInternalMessageEvents[_0x240c('0x4')](_0x25a75a,_0x1827b7);_0x3c3213(null);};}for(var e in events){if(events[_0x240c('0x5')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x240c('0x6')]=ChatInternalMessageEvents;