Built motion from commit (unavailable).|2.4.18
[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 _0xc03e=['hasOwnProperty','hook','exports','events','setMaxListeners','update','emit'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xc03e,0x15a));var _0xec03=function(_0x56825b,_0x172b8d){_0x56825b=_0x56825b-0x0;var _0x69ce77=_0xc03e[_0x56825b];return _0x69ce77;};'use strict';var EventEmitter=require(_0xec03('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xec03('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xec03('0x2'),'afterDestroy':'remove'};function emitEvent(_0xfed10f){return function(_0x269001,_0x3e3a78,_0x194e54){ChatInternalMessageEvents[_0xec03('0x3')](_0xfed10f+':'+_0x269001['id'],_0x269001);ChatInternalMessageEvents[_0xec03('0x3')](_0xfed10f,_0x269001);_0x194e54(null);};}for(var e in events){if(events[_0xec03('0x4')](e)){var event=events[e];ChatInternalMessage[_0xec03('0x5')](e,emitEvent(event));}}module[_0xec03('0x6')]=ChatInternalMessageEvents;