Built motion from commit (unavailable).|2.4.11
[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 _0x2caf=['exports','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0xf7bf02,_0x13da13){var _0x4f263f=function(_0x3b5603){while(--_0x3b5603){_0xf7bf02['push'](_0xf7bf02['shift']());}};_0x4f263f(++_0x13da13);}(_0x2caf,0x6a));var _0xf2ca=function(_0x15718b,_0x20f12e){_0x15718b=_0x15718b-0x0;var _0x2ca779=_0x2caf[_0x15718b];return _0x2ca779;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xf2ca('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf2ca('0x1'),'afterDestroy':_0xf2ca('0x2')};function emitEvent(_0x43b96c){return function(_0x375e8b,_0x137501,_0x27fb1b){ChatInternalMessageEvents[_0xf2ca('0x3')](_0x43b96c+':'+_0x375e8b['id'],_0x375e8b);ChatInternalMessageEvents['emit'](_0x43b96c,_0x375e8b);_0x27fb1b(null);};}for(var e in events){if(events[_0xf2ca('0x4')](e)){var event=events[e];ChatInternalMessage[_0xf2ca('0x5')](e,emitEvent(event));}}module[_0xf2ca('0x6')]=ChatInternalMessageEvents;