237336e5e658ea23a9381998f7d9de9cb454b0ca
[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 _0xeddc=['hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x336ca2,_0x1a813a){var _0xda59a6=function(_0x47caa6){while(--_0x47caa6){_0x336ca2['push'](_0x336ca2['shift']());}};_0xda59a6(++_0x1a813a);}(_0xeddc,0xfc));var _0xcedd=function(_0x34d46f,_0x3e5397){_0x34d46f=_0x34d46f-0x0;var _0x7eeb32=_0xeddc[_0x34d46f];return _0x7eeb32;};'use strict';var EventEmitter=require(_0xcedd('0x0'));var ChatInternalMessage=require(_0xcedd('0x1'))['db'][_0xcedd('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xcedd('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcedd('0x4'),'afterDestroy':_0xcedd('0x5')};function emitEvent(_0x5dd882){return function(_0x26f983,_0x3862ab,_0x2d17f6){ChatInternalMessageEvents[_0xcedd('0x6')](_0x5dd882+':'+_0x26f983['id'],_0x26f983);ChatInternalMessageEvents[_0xcedd('0x6')](_0x5dd882,_0x26f983);_0x2d17f6(null);};}for(var e in events){if(events[_0xcedd('0x7')](e)){var event=events[e];ChatInternalMessage[_0xcedd('0x8')](e,emitEvent(event));}}module[_0xcedd('0x9')]=ChatInternalMessageEvents;