Built motion from commit 9d0783e6.|2.6.13
[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 _0xf064=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0xf064,0xcc));var _0x4f06=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0xf064[_0x58afd5];return _0x3e503b;};'use strict';var EventEmitter=require(_0x4f06('0x0'));var ChatInternalMessage=require(_0x4f06('0x1'))['db'][_0x4f06('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4f06('0x3'),'afterUpdate':_0x4f06('0x4'),'afterDestroy':'remove'};function emitEvent(_0x48764c){return function(_0x43a57a,_0x377693,_0x4d3478){ChatInternalMessageEvents[_0x4f06('0x5')](_0x48764c+':'+_0x43a57a['id'],_0x43a57a);ChatInternalMessageEvents[_0x4f06('0x5')](_0x48764c,_0x43a57a);_0x4d3478(null);};}for(var e in events){if(events[_0x4f06('0x6')](e)){var event=events[e];ChatInternalMessage[_0x4f06('0x7')](e,emitEvent(event));}}module[_0x4f06('0x8')]=ChatInternalMessageEvents;